Browse Source

- Fixed: Permissions are now set after the installation of DreamPower and Waifu2X avoiding getting into a `compatibility error` loop.

- Fixed: Sometimes an error occurred when using the Crop Tool or Custom masks related to a non-existent folder.
- Fixed: The ability to "add to queue" photos in advanced mode has been removed. Previously this caused an error related to `run undefined`
- Fixed: The Waifu2X Updater always downloaded the GPU and CPU version even if you are not using GPU.
- Improvement: The need to install CUDA 10.2 to use Waifu2X is better highlighted. A button has been added to the installation on the "About" page.
- Improvement: More information is provided on how to start in the advanced mode, a button has been added to the guide.
tags/v1.5.4
Ivan Bravo Bravo 4 months ago
parent
commit
8c991c3548

+ 6
- 2
src/assets/css/components/_notification.scss View File

@@ -1,11 +1,11 @@
/*
* DreamTime.
* Copyright (C) DreamNet. All rights reserved.
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License 3.0 as published by
* the Free Software Foundation. See <https://www.gnu.org/licenses/gpl-3.0.html>
*
*
* Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.
*/

@@ -37,4 +37,8 @@
.icon {
@apply mr-2;
}

code {
@apply mx-1 p-1 bg-gray-300;
}
}

+ 12
- 8
src/components/Help/HelpLesson.vue View File

@@ -65,14 +65,6 @@ export default {
<style lang="scss" scoped>
/* purgecss start ignore */
.lesson {
&::v-deep ul {
@apply list-disc;

li {
@apply text-sm ml-3;
}
}

&::v-deep {
&.lesson--small {
.title {
@@ -88,6 +80,18 @@ export default {
}
}

ul {
@apply list-disc;

li {
@apply text-sm ml-3;
}
}

code {
@apply mx-1 p-1 bg-gray-800;
}

.box__photo {
height: 180px;
}

+ 34
- 19
src/components/Nudify/NudifyMaskPhoto.vue View File

@@ -164,15 +164,46 @@ export default {
return
}

const file = await File.fromPath(files[0].path, { watch: false })
try {
const file = await File.fromPath(files[0].path, { watch: false })

file.validateAs('image/png')
file.validateAs('image/png')

this.file.writeFile(file)
this.file.writeFile(file)
} catch (error) {
// eslint-disable-next-line no-console
console.warn(error)
}

event.target.value = ''
},

async onURL(url) {
try {
const file = await File.fromUrl(url, { watch: false })

file.validateAs('image/png')

this.file.writeFile(file)
} catch (error) {
// eslint-disable-next-line no-console
console.warn(error)
}
},

async onFiles(files) {
try {
const file = await File.fromPath(files[0].path, { watch: false })

file.validateAs('image/png')

this.file.writeFile(file)
} catch (error) {
// eslint-disable-next-line no-console
console.warn(error)
}
},

generate() {
this.mask.photo.generateMask(this.mask.id)
},
@@ -194,22 +225,6 @@ export default {
this.renderPhoto = true
})
},

async onURL(url) {
const file = await File.fromUrl(url, { watch: false })

file.validateAs('image/png')

this.file.writeFile(file)
},

async onFiles(files) {
const file = await File.fromPath(files[0].path, { watch: false })

file.validateAs('image/png')

this.file.writeFile(file)
},
},
}
</script>

+ 1
- 1
src/components/Queue/QueuePhoto.vue View File

@@ -10,7 +10,7 @@
<font-awesome-icon icon="external-link-square-alt" />
</button>

<button v-show="photo.pending" v-tooltip="'Add to Queue'" @click="add">
<button v-show="!photo.running && !photo.waiting && !photo.withCustomMasks" v-tooltip="'Add to Queue'" @click="add">
<font-awesome-icon icon="play" />
</button>


+ 0
- 9
src/components/UI/ProjectUpdate.vue View File

@@ -42,15 +42,6 @@
Update
</button>

<a v-if="project === 'waifu' && $settings.preferences.advanced.device === 'GPU'"
v-tooltip="'Install this to use Waifu2X on GPU.'"
class="button button--success"
href="https://developer.nvidia.com/cuda-10.2-download-archive"
target="_blank">
<span class="icon"><font-awesome-icon icon="external-link-square-alt" /></span>
<span>CUDA 10.2</span>
</a>

<button v-show="updater.update.active" class="button button--danger" @click.prevent="updater.cancel()">
<span class="icon"><font-awesome-icon icon="stop" /></span>
Cancel

+ 1
- 1
src/electron/src/modules/tools/fs.js View File

@@ -44,7 +44,7 @@ export function read(path, encoding = 'utf-8') {
*/
export function writeDataURL(path, dataURL) {
const data = this.getBase64Data(dataURL)
return fs.writeFileSync(path, data, 'base64')
return fs.outputFileSync(path, data, 'base64')
}

/**

+ 18
- 6
src/modules/config/cli-errors.json View File

@@ -27,6 +27,10 @@
"query": "enforce fail at CPUAllocator",
"message": "You have run out of RAM on your system! Please buy more RAM before using DreamTime."
},
{
"query": "MemoryError : Unable to allocate",
"message": "You have run out of RAM on your system! Please buy more RAM before using DreamTime."
},
{
"query": "CUDA out of memory",
"message": "Your GPU doesn't have enough VRAM! Please use CPU processing or buy a new GPU with more than 8 GB of VRAM."
@@ -53,7 +57,7 @@
},
{
"query": "file is not valid image",
"message": "Image error: The photo could not be loaded correctly. Please make sure the photo is valid, has not been deleted and is not corrupt."
"message": "Image error: The photo could not be loaded correctly. Please make sure the photo is valid, has not been deleted and is not corrupted."
},
{
"query": "cv2.error",
@@ -61,23 +65,31 @@
},
{
"query": "is not a valid file or directory or url",
"message": "Image error: The photo could not be loaded correctly. Please make sure the photo is valid, has not been deleted and is not corrupt."
"message": "Image error: The photo could not be loaded correctly. Please make sure the photo is valid, has not been deleted and is not corrupted."
},
{
"query": "file not a supported format",
"message": "Image error: The photo could not be loaded correctly. Please make sure the photo is valid, has not been deleted and is not corrupt."
"message": "Image error: The photo could not be loaded correctly. Please make sure the photo is valid, has not been deleted and is not corrupted."
},
{
"query": "invalid extension format",
"message": "Image error: The photo could not be loaded correctly. Please make sure the photo is valid, has not been deleted and is not corrupt."
"message": "Image error: The photo could not be loaded correctly. Please make sure the photo is valid, has not been deleted and is not corrupted."
},
{
"query": "The file might be corrupted",
"message": "Image error: The photo could not be loaded correctly. Please make sure the photo is valid, has not been deleted and is not corrupt."
"message": "Image error: The photo could not be loaded correctly. Please make sure the photo is valid, has not been deleted and is not corrupted."
},
{
"query": "libpng error: PNG input buffer is incomplete",
"message": "Image error: The photo could not be loaded correctly. Please make sure the photo is valid, has not been deleted and is not corrupted."
},
{
"query": "OSError: image file is truncated",
"message": "Image error: The photo could not be loaded correctly. Please make sure the photo is valid, has not been deleted and is not corrupted."
},
{
"query": "Could not find a format to read the specified file",
"message": "Image error: The photo could not be loaded correctly. Please make sure the photo is valid, has not been deleted and is not corrupt."
"message": "Image error: The photo could not be loaded correctly. Please make sure the photo is valid, has not been deleted and is not corrupted."
},
{
"query": "PIL.Image.DecompressionBombError",

+ 1
- 1
src/modules/consola/log.js View File

@@ -164,7 +164,7 @@ export class Log {
this.logger[this.level](this.message)

if (this.error) {
this.logger.error('Exception:', this.error)
this.logger[this.level](this.error)
}

if (this.isError) {

+ 1
- 1
src/modules/file.js View File

@@ -358,7 +358,7 @@ export class File extends EventEmitter {
}

write(data) {
fs.writeFileSync(this.path, data)
fs.outputFileSync(this.path, data)

this.emit('writed')


+ 4
- 0
src/modules/nudify/nudify.js View File

@@ -224,6 +224,10 @@ export const Nudify = {
return
}

if (photo.withCustomMasks) {
return
}

photo.add()
})
},

+ 5
- 1
src/modules/nudify/photo-run.js View File

@@ -520,10 +520,14 @@ export class PhotoRun {
return null
}

const terminalText = this.cli.lines.map((item) => item.text)

this.photo.consola.warn(terminalText.join('\n'))

const title = 'Nudification failed!'

const extra = {
terminal: this.cli.lines.map((item) => item.text),
terminal: terminalText,
}

for (const payload of cliErrors) {

+ 3
- 1
src/modules/services/logrocket.js View File

@@ -13,6 +13,7 @@ import { BaseService } from './base'
import { dreamtrack } from './dreamtrack'
import { settings } from '../system/settings'
import { Consola } from '../consola'
import { requirements } from '../system'

const { system } = $provider

@@ -36,7 +37,7 @@ class LogRocketService extends BaseService {
* @type {boolean}
*/
get can() {
return system.online && isString(this.accessToken) && settings.telemetry?.dom
return system.online && isString(this.accessToken) && settings.telemetry?.dom && requirements.canNudify
}

/**
@@ -55,6 +56,7 @@ class LogRocketService extends BaseService {
shouldCaptureIP: false,
console: {
isEnabled: true,
shouldAggregateConsoleErrors: false,
},
network: {
isEnabled: true,

+ 12
- 1
src/modules/updater/dreampower.js View File

@@ -116,6 +116,7 @@ class DreamPowerUpdater extends BaseUpdater {
async install(filepath) {
const powerPath = getPowerPath()

// Removing the previous installation
try {
if (fs.existsSync(powerPath)) {
const files = await fs.readdir(powerPath)
@@ -132,9 +133,19 @@ class DreamPowerUpdater extends BaseUpdater {
this.consola.warn(error)
}

// Extraction
await fs.extractSeven(filepath, powerPath)

// restart!
// Permissions for non-windows operating systems.
if (process.platform !== 'win32') {
try {
fs.chmodSync(getPowerPath('dreampower'), 0o775)
} catch (error) {
this.consola.warn(error)
}
}

// Restart!
app.relaunch()
app.quit()
}

+ 28
- 2
src/modules/updater/waifu.js View File

@@ -11,7 +11,7 @@ import path from 'path'
import { isNil } from 'lodash'
import compareVersions from 'compare-versions'
import { BaseUpdater } from './base'
import { requirements } from '../system'
import { requirements, settings } from '../system'
import { dreamtrack } from '../services'

const { getVersion } = $provider.waifu
@@ -35,6 +35,21 @@ class WaifuUpdater extends BaseUpdater {
return super.githubRepo || 'dreamnettech/waifu2x-chainer'
}

/**
* @type {string}
*/
get platform() {
let platform = super.platform

if (platform === 'macos' || settings.preferences.advanced.device === 'CPU') {
platform = `${platform}-cpuonly`
} else {
platform = `${platform}-any`
}

return platform
}

/**
* @return {string}
*/
@@ -96,6 +111,7 @@ class WaifuUpdater extends BaseUpdater {
async install(filepath) {
const waifuPath = getWaifuPath()

// Removing the previous installation
try {
if (fs.existsSync(waifuPath)) {
const files = await fs.readdir(waifuPath)
@@ -108,9 +124,19 @@ class WaifuUpdater extends BaseUpdater {
this.consola.warn(error)
}

// Extraction
await fs.extractSeven(filepath, waifuPath)

// restart!
// Permissions for non-windows operating systems.
if (process.platform !== 'win32') {
try {
fs.chmodSync(getWaifuPath('waifu2x'), 0o775)
} catch (error) {
this.consola.warn(error)
}
}

// Restart!
app.relaunch()
app.quit()
}

+ 11
- 0
src/pages/about/waifu.vue View File

@@ -1,5 +1,10 @@
<template>
<div class="project">
<div v-if="isMacOS" class="notification">
<h5>Waifu2X on Mac OS is experimental!</h5>
You may need to run the command <code>brew install openblas</code> before using it.
</div>

<div class="project__content">
<div class="box">
<div class="box__header">
@@ -57,6 +62,12 @@ export default {
data: () => ({
requirements,
}),

computed: {
isMacOS() {
return process.platform === 'darwin'
},
},
}
</script>


+ 26
- 9
src/pages/nudify/_id/results.vue View File

@@ -8,17 +8,24 @@
</h2>

<h3 class="subtitle">
Generate and customize the masks to create the nude of your dreams.
<AppTip :tooltip="{ content: 'As long as you stay on this page the drag and drop functionality will be limited to masks.', placement: 'bottom' }" />
Manually generate and improve the algorithm masks.
<AppTip :tooltip="{ content: tooltip, placement: 'bottom' }" />
</h3>

<template v-slot:right>
<button v-tooltip="{ content: 'Open the folder where the masks are stored.<br><br>The changes you make externally in the files will be reflected in real time here.', placement: 'bottom' }"
class="button"
@click.prevent="openMasksFolder">
<span class="icon"><font-awesome-icon icon="folder-open" /></span>
<span>Masks</span>
</button>
<div class="buttons">
<a class="button button--info" href="https://dreamtime.tech/docs/guide/custom-masks" target="_blank">
<span class="icon"><font-awesome-icon icon="question-circle" /></span>
<span>Guide</span>
</a>

<button
class="button"
@click.prevent="openMasksFolder">
<span class="icon"><font-awesome-icon icon="folder-open" /></span>
<span>Masks</span>
</button>
</div>
</template>
</PageHeader>

@@ -107,10 +114,20 @@ export default {
preferences() {
return this.photo.preferences
},

tooltip() {
return `- Generate mask by mask by clicking on the green button.<br>
- The changes you make externally to the masks will be captured in real time.<br>
- As long as you stay on this page the drag and drop functionality will be limited to the masks box.<br><br>

Read the guide to better understand this mode.`
},
},

mounted() {
this.$store.commit('app/setDragDropEnabled', false)
if (this.photo.withCustomMasks) {
this.$store.commit('app/setDragDropEnabled', false)
}
},

methods: {

+ 16
- 0
src/pages/wizard/waifu.vue View File

@@ -28,6 +28,16 @@
Installed version: <strong>{{ $waifu.currentVersion }}</strong>
</div>

<div v-if="isMacOS" class="notification">
<h5>Waifu2X on Mac OS is experimental!</h5>
You may need to run the command <code>brew install openblas</code> before using it.
</div>

<div v-if="$settings.preferences.advanced.device === 'GPU'" class="notification">
<h5>Waifu2X require CUDA 10.2</h5>
Before using Waifu2X on GPU please <a href="https://developer.nvidia.com/cuda-10.2-download-archive" target="_blank">download and install CUDA 10.2</a>
</div>

<AppBox>
<ProjectUpdate project="waifu" />
</AppBox>
@@ -75,6 +85,12 @@ export default {
requirements,
}),

computed: {
isMacOS() {
return process.platform === 'darwin'
},
},

methods: {
showOpenDialog(path) {
const dir = dialog.showOpenDialogSync({

Loading…
Cancel
Save