Browse Source

- Moved: Alerts from the Alerts center into the application settings.

- Added: "Show terminal" button in advanced mode.
- Added: Image size
- Added: Compression
- Removed: Windows Media Feature Pack requirement check.
- Fixed: Various problems when DreamPower is not working properly.
- Fixed: Occasionally the DreamPower update failed.
- Fixed: Error when deleting the files from custom masks.
tags/v1.5.3
Ivan Bravo Bravo 4 months ago
parent
commit
a90f320bc0

+ 1
- 1
src/assets/css/reset/_dialog.scss View File

@@ -33,5 +33,5 @@ dialog {
}

dialog::backdrop {
background: rgba(25, 25, 26, 0.75);
background: rgba(25, 25, 26, 0.90);
}

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

@@ -63,6 +63,7 @@ export default {
</script>

<style lang="scss" scoped>
/* purgecss start ignore */
.lesson {
&::v-deep ul {
@apply list-disc;
@@ -81,51 +82,52 @@ export default {
.box__content {
@apply text-xs #{!important};
}

.box__photo {
height: 130px;
}
}

.box__photo {
height: 180px;
}

.photo--drag {
//background-color: #593C48;
background-image: url('~assets/images/undraw/undraw_throw_down_ub2l.svg')
}

.photo--tips {
//background-color: #C27091;
background-image: url('~assets/images/undraw/undraw_depi_wexf.svg')
}

.photo--settings {
//background-color: #C27091;
background-image: url('~assets/images/undraw/undraw_personal_settings_kihd.svg')
}

.photo--preferences {
//background-color: #607AA9;
background-image: url('~assets/images/undraw/undraw_making_art_759c.svg')
background-image: url('~assets/images/undraw/undraw_female_avatar_w3jk.svg')
}

.photo--better-results {
//background-color: #607AA9;
background-image: url('~assets/images/undraw/undraw_blank_canvas_3rbb.svg')
}

.photo--tips-ads {
//background-color: #506896;
background-image: url('~assets/images/undraw/undraw_elements_cipa.svg')
}

.photo--preferences-mode {
//background-color: #D9B6C4;
background-image: url('~assets/images/undraw/undraw_selected_options_42hx.svg')
}

.photo--videos {
background-image: url('~assets/images/undraw/undraw_video_files_fu10.svg')
}
}
}

.box__photo {
@apply bg-contain;
.photo--masks {
background-image: url('~assets/images/undraw/undraw_making_art_759c.svg')
}
}
}

.box__footer {
@@ -133,4 +135,5 @@ export default {
@apply mr-2;
}
}
/* purgecss end ignore */
</style>

+ 41
- 0
src/components/Nudify/NudifyMaskPhoto.vue View File

@@ -54,6 +54,14 @@
<FontAwesomeIcon icon="save" />
</button>

<button v-if="mask.run"
key="button-terminal"
v-tooltip="'View terminal'"
class="button button--sm"
@click.prevent="$refs.terminalDialog.showModal()">
<font-awesome-icon icon="terminal" />
</button>

<button v-if="mask.canShowGenerate && mask.photo.running"
key="stop"
v-tooltip="'Stop Generation.'"
@@ -78,6 +86,26 @@
<FontAwesomeIcon icon="play" />
</button>
</div>

<!-- Terminal Dialog -->
<dialog v-if="mask.run" ref="terminalDialog">
<div class="dialog__content">
<div class="terminal">
<li
v-for="(item, index) in mask.run.cli.lines"
:key="index"
:class="item.css">
> {{ item.text }}
</li>
</div>

<div class="dialog__buttons">
<button class="button button--danger" @click="$refs.terminalDialog.close()">
Close
</button>
</div>
</div>
</dialog>
</div>
</template>

@@ -245,4 +273,17 @@ export default {
max-width: 90px;
}
}

.terminal {
@apply p-2 bg-black overflow-auto rounded;
height: 400px;

li {
@apply font-mono text-xs text-generic-100 mb-3 block;

&.text-danger {
@apply text-danger-500;
}
}
}
</style>

+ 6
- 1
src/components/Settings/SettingsField.vue View File

@@ -69,6 +69,11 @@ export default {
type: Boolean,
default: false,
},

ignoreHardcoded: {
type: Boolean,
defalt: false,
},
},

data: () => ({
@@ -98,7 +103,7 @@ export default {
let fieldId = this.field.id

// FIXME: HARD CODED!
if (fieldId.includes('preferences.')) {
if (!this.ignoreHardcoded && fieldId.includes('preferences.')) {
fieldId = fieldId.substring('preferences.'.length)
}


+ 18
- 0
src/components/Settings/SettingsPreferences.vue View File

@@ -78,6 +78,20 @@
</div>

<div class="box__content">
<SettingsField v-if="!isMacOS" v-model="value$" field-id="preferences.advanced.device" />

<SettingsField v-else field-id="preferences.advanced.device" description="Mac only supports CPU.">
<select v-model="value$.advanced.device" class="input" disabled>
<option value="CPU">
CPU
</option>
</select>
</SettingsField>

<SettingsField v-show="value$.advanced.scaleMode !== 'none'" v-model="value$" field-id="preferences.advanced.imageSize" />

<SettingsField v-model="value$" field-id="preferences.advanced.compress" />

<SettingsField v-show="value$.advanced.scaleMode === 'padding'" v-model="value$" field-id="preferences.advanced.useColorPaddingStrip" />

<SettingsField v-model="value$" field-id="preferences.advanced.useColorTransfer" />
@@ -138,6 +152,10 @@ export default {
optionsField() {
return this.animated ? 'animated-options' : 'options'
},

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

mounted() {

+ 1
- 1
src/components/UI/ProjectUpdate.vue View File

@@ -42,7 +42,7 @@
Update
</button>

<a v-if="project === 'waifu' && $settings.processing.device === 'GPU'"
<a v-if="project === 'waifu' && $settings.preferences.advanced.device === 'GPU'"
v-tooltip="'Software required to use Waifu2X on GPU.'"
class="button button--danger"
href="https://developer.nvidia.com/cuda-10.2-download-archive"

+ 1
- 1
src/electron/src/index.js View File

@@ -146,7 +146,7 @@ class DreamApp {
enforceMacOSAppLocation()

// PyTorch does not have support for GPU in macOS
settings.processing.device = 'CPU'
settings.preferences.advanced.device = 'CPU'
}

// application exit.

+ 25
- 4
src/electron/src/modules/settings.js View File

@@ -136,7 +136,7 @@ class Settings {
const hasGPU = process.platform === 'darwin' ? false : system.graphics.length > 0

this.payload = {
version: 8,
version: 9,
user: uuid(),

wizard: {
@@ -179,7 +179,6 @@ class Settings {
},

processing: {
device: hasGPU ? 'GPU' : 'CPU',
gpus: [0],
cores: 1,
usePython: false,
@@ -243,10 +242,12 @@ class Settings {
},

advanced: {
device: hasGPU ? 'GPU' : 'CPU',
scaleMode: 'overlay',
transformMode: 'normal',
useColorTransfer: false,
useColorPaddingStrip: true,
compress: 0,
imageSize: 512,
waifu: {
enabled: false,
scale: 2,
@@ -366,7 +367,7 @@ class Settings {
// 4 -> 5
if (this.payload?.version === 4 && this._default.version >= 5) {
this.payload.version = 5
this.payload.preferences.advanced.transformMode = 'normal'
// this.payload.preferences.advanced.transformMode = 'normal'
}

// 5 -> 6
@@ -472,6 +473,26 @@ class Settings {
}
}

if (this.payload?.version === 8 && this._default.version >= 9) {
this.payload = merge(this.payload, {
version: 9,
preferences: {
advanced: {
device: this.payload.processing.device,
compress: 0,
imageSize: 512,
},
},
})

// This throws on some Windows 10 systems.
try {
delete this.payload.processing.device
} catch (err) {
logger.warn(err)
}
}

this.save()
}
}

+ 21
- 32
src/electron/src/modules/tools/power.js View File

@@ -32,12 +32,10 @@ export function exec(args, options = {}) {
})

// FIXME: Anaconda support.
/*
return spawn('C:\\Users\\koles\\Anaconda3\\envs\\dreampower\\python', args, {
/* return spawn('C:\\Users\\koles\\Anaconda3\\envs\\dreampower\\python', args, {
cwd: getPowerPath(),
...options,
})
*/
}) */

return spawn('python', args, {
cwd: getPowerPath(),
@@ -68,13 +66,13 @@ export async function nudify(args, events) {
})

process.stdout.on('data', (output) => {
// logger.info(output.toString())
logger.info(output.toString())
const stdout = output.toString().trim().split('\n')
events.emit('stdout', null, stdout)
})

process.stderr.on('data', (output) => {
// logger.warn(output.toString())
logger.warn(output.toString())
events.emit('stderr', null, output)
})

@@ -154,8 +152,13 @@ export const transform = (run) => {
args.push('--output', run.outputFile.path)
}

const {
useColorTransfer, scaleMode, compress, imageSize, device,
} = preferences.advanced
const { geometry } = photo

// Device
if (settings.processing.device === 'CPU') {
if (device === 'CPU') {
args.push('--cpu')
} else {
for (const id of settings.processing.gpus) {
@@ -165,47 +168,33 @@ export const transform = (run) => {

args.push('--n-cores', settings.processing.cores)

const { useColorTransfer, scaleMode } = preferences.advanced
const { geometry } = photo

if (scaleMode === 'overlay') {
args.push(
'--overlay',
`${geometry.overlay.startX},${geometry.overlay.startY}:${geometry.overlay.endX},${geometry.overlay.endY}`,
)

/*
end += 2

if (start > 0) {
start += 2
}

if (start === 5) {
end += 1
}
*/
} else if (scaleMode !== 'none' && scaleMode !== 'cropjs' && scaleMode !== 'padding') {
args.push(`--${scaleMode}`)
}

/*
end += 1
if (scaleMode === 'none') {
args.push('--ignore-size')
} else {
args.push('--image-size', imageSize)
}

if (start > 0) {
start += 1
if (start === 0) {
// Image compression.
if (compress > 0) {
args.push('--compress', compress)
}
*/
}

// Color transfer.
if (useColorTransfer) {
args.push('--color-transfer')
}

// Advanced preferences
if (start > 0) {
// args.push('--ignore-size')
}

// Custom masks.
if (run.isMaskGeneration) {
args.push('--masks-path', photo.masksPath)

+ 2
- 2
src/electron/src/modules/tools/waifu.js View File

@@ -99,7 +99,7 @@ export const transform = (photoPreferences, input, output) => {
output = input
}

const { waifu: preferences } = photoPreferences.advanced
const { waifu: preferences, device } = photoPreferences.advanced

// CLI Args
const args = ['--input', input, '--output', output]
@@ -126,7 +126,7 @@ export const transform = (photoPreferences, input, output) => {
}

// GPU
if (settings.processing.device === 'GPU') {
if (device === 'GPU') {
for (const id of settings.processing.gpus) {
args.push('--gpu', id)
}

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

@@ -29,7 +29,7 @@
},
{
"query": "CUDA out of memory",
"message": "You have run out of VRAM on your GPU! Make sure there are no other programs using your GPU or purchase a GPU with more memory before using DreamTime."
"message": "Your GPU doesn't have enough VRAM! The algorithm is out of VRAM to process the photo, please buy a new GPU with more VRAM or use CPU processing."
},
{
"query": "codec can't decode byte",

+ 19
- 5
src/modules/config/help.yml View File

@@ -1,8 +1,8 @@
- title: Drag and Drop!
photo: drag
buttons:
- text: Online Guide
href: https://time.dreamnet.tech/docs/guide/upload
- text: Guide
href: https://dreamtime.tech/docs/guide/upload
summary: |-
No matter where you are, you can always drag and drop your photos and folders.
content: |-
@@ -12,7 +12,7 @@
photo: tips
buttons:
- text: More information
href: https://time.dreamnet.tech/docs/guide/photos
href: https://dreamtime.tech/docs/guide/photos
summary: |-
Not all photos provide good results, click here to know the characteristics of a good photo.
content: |-
@@ -80,7 +80,19 @@
- **Minimal:** Only options for body personalization. Everything will be adjusted to make the process totally automatic.
- **Simple:** Same as Minimal. Allows you to change the Scale mode.
- **Normal:** All options available, this is the original DreamTime experience.
- **Advanced:** Mode to work with Custom masks. The results interface changes to show each mask, this mode requires time and experience making manual modifications to the photos but can improve the results dramatically.
- **Advanced:** Custom masks mode. The results interface changes to work with each mask, this mode requires time and experience making manual modifications to the photos but can improve the results dramatically.

- title: Custom masks.
photo: masks
buttons:
- text: Guide
href: https://dreamtime.tech/docs/guide/custom-masks
summary: |-
The custom masks or "advanced mode" allows you to obtain results that only a human could create!
content: |-
With the custom masks or "advanced mode" you can work with the masks generated by the algorithm and obtain results that DreamPower alone is not capable of.

Visit the guide to get all the information and tips necessary to start using this mode!

- title: Tips? Ads? You decide.
photo: tips-ads
@@ -105,4 +117,6 @@
content: |-
With DreamTime you can nudify gifs, webm and mp4 videos, from the Internet or by uploading the files to the application.

**Be sure to use short videos, otherwise prepare to meet the RAM eating beast.**
**Be sure to use short duration videos, otherwise prepare to meet the RAM eating beast.**



+ 33
- 3
src/modules/config/settings.yml View File

@@ -65,9 +65,9 @@
- label: Disabled
value: false

- id: processing.device
- id: preferences.advanced.device
label: Device.
description: Device that algorithms will use. GPU is faster.
description: GPU is faster but depends on the device VRAM. CPU is slower but uses system RAM.
input: select
options:
- label: CPU
@@ -117,7 +117,7 @@

- id: preferences.advanced.scaleMode
label: Scale method.
description: Indicates how the photo will be scaled to 512x512.
description: Indicates how the photo will be scaled.
input: select
options:
- label: None
@@ -197,6 +197,36 @@
- label: Disabled
value: false

- id: preferences.advanced.imageSize
label: Image size.
description: Size for photo rescale. Larger sizes requires more RAM and can produce less satisfactory results.
input: select
options:
- label: 256x256
value: 256
- label: 512x512
value: 512
- label: 768x768
value: 768
- label: 1024x1024
value: 1024
- label: 1280x1280
value: 1280

- id: preferences.advanced.compress
label: Compression level.
description: Compress the photo before nudification to save RAM.
input: select
options:
- label: Disabled
value: 0
- label: Low
value: 25
- label: Medium
value: 50
- label: High
value: 75

- id: preferences.advanced.waifu.enabled
label: Waifu2X.
description: Use an algorithm to upscale & denoise the nudified photo.

+ 24
- 0
src/modules/helpers.js View File

@@ -6,3 +6,27 @@
// the Free Software Foundation. See <https://www.gnu.org/licenses/gpl-3.0.html>
//
// Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.

export function closestNumber(n, m = 16) {
// Find the quotient
const q = parseInt(n / m, 10)

// 1st possible closest number
const n1 = m * q
let n2

// 2nd possible closest number
if ((n * m) > 0) {
n2 = (m * (q + 1))
} else {
n2 = (m * (q - 1))
}

// if true, then n1 is the required closest number
if (Math.abs(n - n1) < Math.abs(n - n2)) {
return n1
}

// else n2 is the required closest number
return n2
}

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

@@ -232,6 +232,7 @@ export class PhotoRun {
}

this.preferences.advanced.scaleMode = this.photo.scaleMode
this.preferences.advanced.imageSize = this.photo.imageSize
}

/**

+ 21
- 15
src/modules/nudify/photo.js View File

@@ -26,6 +26,7 @@ import { PhotoMask, STEP } from './photo-mask'
import { File } from '../file'
import { Timer } from '../timer'
import { events } from '../events'
import { closestNumber } from '../helpers'

const { getCurrentWindow } = require('electron').remote

@@ -383,6 +384,17 @@ export class Photo {
return scaleMode !== this.scaleMode
}

/**
*
*
* @type {number}
* @readonly
*/
get imageSize() {
const { imageSize } = this.preferences.advanced
return closestNumber(imageSize)
}

/**
* Returns the final scale mode after validations.
*
@@ -716,13 +728,15 @@ export class Photo {
return
}

const { imageSize } = this

const canvas = this.cropper.getCroppedCanvas({
width: 512,
height: 512,
minWidth: 512,
minHeight: 512,
maxWidth: 512,
maxHeight: 512,
width: imageSize,
height: imageSize,
minWidth: imageSize,
minHeight: imageSize,
maxWidth: imageSize,
maxHeight: imageSize,
fillColor: 'white',
imageSmoothingEnabled: true,
imageSmoothingQuality: 'high',
@@ -861,19 +875,11 @@ export class Photo {
*/
track() {
const { mode } = this.preferences
const { transformMode, useColorTransfer } = this.preferences.advanced
const { useColorTransfer } = this.preferences.advanced
const { randomize, progressive } = this.preferences.body

consola.track('DREAM_START', { mode })

if (transformMode === 'export-maskfin') {
consola.track('DREAM_EXPORT_MASKFIN')
}

if (transformMode === 'import-maskfin') {
consola.track('DREAM_IMPORT_MASKFIN')
}

if (useColorTransfer) {
consola.track('DREAM_COLOR_TRANSFER')
}

+ 1
- 1
src/modules/projects/dreamtime.js View File

@@ -66,7 +66,7 @@ class DreamTime {

openAppDataFolder() {
if (this.isPortable) {
this.openAppFolder()
shell.openPath(getAppPath('AppData'))
return
}


+ 4
- 62
src/modules/system/requirements.js View File

@@ -8,9 +8,8 @@
// Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.

import {
isNil, startsWith, pick, clone, deburr,
isNil, pick, clone, deburr,
} from 'lodash'
import { remote } from 'electron'
import emojiStrip from 'emoji-strip'
import { Consola } from '../consola'
import { settings } from './settings'
@@ -20,8 +19,7 @@ const consola = Consola.create('requirements')
const {
system, fs, power, waifu,
} = $provider
const { is } = $provider.util
const { getAppResourcesPath, getCheckpointsPath, getModelsPath } = $provider.paths
const { getCheckpointsPath, getModelsPath } = $provider.paths

export const requirements = {
power: {
@@ -35,10 +33,6 @@ export const requirements = {
compatible: false,
},

windows: {
media: false,
},

recommended: {
ram: false,
vram: false,
@@ -64,15 +58,11 @@ export const requirements = {
},

get hasAlerts() {
if (!this.windows.media) {
return true
}

if (!this.recommended.ram) {
return true
}

if (settings.processing.device === 'GPU' && !this.recommended.vram) {
if (settings.preferences.advanced.device === 'GPU' && !this.recommended.vram) {
return true
}

@@ -96,9 +86,6 @@ export const requirements = {
this.waifu.installed = waifu.isInstalled()
this.waifu.compatible = await this._hasCompatibleWaifu()

// windows
this.windows.media = await this._hasWindowsMedia()

// ram
this.recommended.ram = system.memory.total >= 12884901888 // 12 GB
this.recommended.vram = system.graphics[0]?.vram >= 4000 // Win32_VideoController does not scan VRAM above 4GB
@@ -143,7 +130,7 @@ export const requirements = {
version = await power.getVersion()
const currentVersion = `v${process.env.npm_package_version}`

const minimum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'dreampower', 'minimum'], 'v1.2.8')
const minimum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'dreampower', 'minimum'], 'v1.2.10')
const maximum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'dreampower', 'maximum'])

if (compareVersions.compare(version, minimum, '<')) {
@@ -225,49 +212,4 @@ export const requirements = {

return true
},

/**
* @return {boolean}
*/
async _hasWindowsMedia() {
if (!is.windows) {
return true
}

const version = system.os.release

if (!startsWith(version, '10')) {
// no windows 10.
return true
}

try {
const regedit = remote.require('regedit')

if (!is.development) {
// regedit commands
regedit.setExternalVBSLocation(
getAppResourcesPath('vbs'),
)
}

const value = await new Promise((resolve) => {
const regKey = 'HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\WindowsFeatures'

regedit.list(regKey, (err, result) => {
if (!isNil(err)) {
resolve(false)
return
}

resolve(result[regKey].keys.includes('WindowsMediaVersion'))
})
})

return value
} catch (error) {
consola.warn(error)
return false
}
},
}

+ 32
- 9
src/modules/updater/dreampower.js View File

@@ -7,6 +7,7 @@
//
// Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.

import path from 'path'
import { isNil } from 'lodash'
import compareVersions from 'compare-versions'
import { BaseUpdater } from './base'
@@ -15,7 +16,7 @@ import { dreamtrack } from '../services'

const { getVersion } = $provider.power
const { getPowerPath } = $provider.paths
const { extractSeven } = $provider.fs
const { fs } = $provider
const { activeWindow } = $provider.util
const { app, Notification } = $provider.api

@@ -40,7 +41,7 @@ class DreamPowerUpdater extends BaseUpdater {
get platform() {
let platform = super.platform

if (platform === 'macos' || settings.processing.device === 'CPU') {
if (platform === 'macos' || settings.preferences.advanced.device === 'CPU') {
platform = `${platform}-cpuonly`
} else {
platform = `${platform}-any`
@@ -57,13 +58,17 @@ class DreamPowerUpdater extends BaseUpdater {
return 'v0.0.0'
}

const version = await getVersion()
try {
const version = await getVersion()

if (isNil(version)) {
return 'v1.1.0'
}
if (isNil(version)) {
return 'v0.0.0'
}

return version
return version
} catch (error) {
return 'v0.0.0'
}
}

/**
@@ -73,7 +78,7 @@ class DreamPowerUpdater extends BaseUpdater {
_getLatestCompatible(releases) {
const currentVersion = `v${process.env.npm_package_version}`

const minimum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'dreampower', 'minimum'], 'v1.2.8')
const minimum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'dreampower', 'minimum'], 'v1.2.10')
const maximum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'dreampower', 'maximum'])

if (!minimum) {
@@ -109,7 +114,25 @@ class DreamPowerUpdater extends BaseUpdater {
* @param {string} filepath
*/
async install(filepath) {
await extractSeven(filepath, getPowerPath())
const powerPath = getPowerPath()

try {
if (fs.existsSync(powerPath)) {
const files = await fs.readdir(powerPath)

for (const file of files) {
if (file.includes('checkpoints')) {
continue
}

fs.removeSync(path.join(powerPath, file))
}
}
} catch (error) {
this.consola.warn(error)
}

await fs.extractSeven(filepath, powerPath)

// restart!
app.relaunch()

+ 23
- 4
src/modules/updater/waifu.js View File

@@ -7,6 +7,7 @@
//
// Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.

import path from 'path'
import { isNil } from 'lodash'
import compareVersions from 'compare-versions'
import { BaseUpdater } from './base'
@@ -15,7 +16,7 @@ import { dreamtrack } from '../services'

const { getVersion } = $provider.waifu
const { getWaifuPath } = $provider.paths
const { extractSeven } = $provider.fs
const { fs } = $provider
const { activeWindow } = $provider.util
const { app, Notification } = $provider.api

@@ -42,8 +43,12 @@ class WaifuUpdater extends BaseUpdater {
return 'v0.0.0'
}

const version = await getVersion()
return version
try {
const version = await getVersion()
return version
} catch (error) {
return 'v0.0.0'
}
}

/**
@@ -89,7 +94,21 @@ class WaifuUpdater extends BaseUpdater {
* @param {string} filepath
*/
async install(filepath) {
await extractSeven(filepath, getWaifuPath())
const waifuPath = getWaifuPath()

try {
if (fs.existsSync(waifuPath)) {
const files = await fs.readdir(waifuPath)

for (const file of files) {
fs.removeSync(path.join(waifuPath, file))
}
}
} catch (error) {
this.consola.warn(error)
}

await fs.extractSeven(filepath, waifuPath)

// restart!
app.relaunch()

+ 2
- 3
src/nuxt.config.js View File

@@ -95,7 +95,7 @@ module.exports = {
// Doc: https://github.com/nuxt-community/style-resources-module
'@nuxtjs/style-resources',
// Doc: https://github,.com/Developmint/nuxt-purgecss
'nuxt-purgecss',
// 'nuxt-purgecss',
],

/*
@@ -121,8 +121,7 @@ module.exports = {
*
*/
purgeCSS: {
enabled: false, // FIXME: Final release
mode: 'webpack',
enabled: true,
},

/**

+ 1
- 1
src/package.json View File

@@ -3,7 +3,7 @@
"private": true,
"displayName": "DreamTime",
"description": "Application that uses artificial intelligence to generate fake nudes.",
"version": "1.5.2",
"version": "1.5.3",
"homepage": "https://time.dreamnet.tech",
"main": "electron/dist/index.js",
"license": "GPL-3.0-only",

+ 1
- 1
src/package.min.json View File

@@ -3,7 +3,7 @@
"private": true,
"displayName": "DreamTime",
"description": "Application that uses artificial intelligence to generate fake nudes.",
"version": "1.5.2",
"version": "1.5.3",
"main": "electron/dist/index.js",
"license": "GPL-3.0-only"
}

+ 0
- 107
src/pages/alerts.vue View File

@@ -1,107 +0,0 @@
<template>
<div class="alerts content__body">
<div class="wrapper">
<!-- Models Folder -->
<div v-if="!requirements.folders.models"
class="notification notification--danger">
<span class="icon"><font-awesome-icon icon="exclamation-triangle" /></span>
<span v-if="!$dream.isPortable">
The <strong>Models</strong> folder has <strong>invalid characters</strong>.
Please change the location of the folder in the <nuxt-link to="/settings/folders">settings</nuxt-link>.
</span>
<span v-else>
The place where you have extracted {{ $dream.name }} has <strong>invalid characters</strong>.
Please move the application to another place.
</span>
</div>

<div v-else
class="notification notification--success">
<span class="icon"><font-awesome-icon icon="check-circle" /></span>
<span>The <strong>Models</strong> folder is valid. There should be no problems saving the nudified photos.</span>
</div>

<!-- GPU -->
<div v-if="$settings.processing.device === 'GPU'">
<div v-if="!requirements.recommended.vram"
class="notification notification--danger">
<span class="icon"><font-awesome-icon icon="exclamation-triangle" /></span>
<span>Your NVIDIA GPU has less than <strong>4 GB</strong> of VRAM.</span>
</div>
<div v-else
class="notification notification--success">
<span class="icon"><font-awesome-icon icon="check-circle" /></span>
<span>Your NVIDIA GPU meets the minimum amount of VRAM.</span>
</div>
</div>

<!-- RAM -->
<div v-if="!requirements.recommended.ram"
class="notification notification--warning">
<span class="icon"><font-awesome-icon icon="exclamation-triangle" /></span>
<span>Your system has less than <strong>12 GB</strong> of RAM. Please buy more RAM!</span>
</div>
<div v-else
class="notification notification--success">
<span class="icon"><font-awesome-icon icon="check-circle" /></span>
<span>Your system meets the minimum amount of RAM.</span>
</div>

<!-- Windows Media Feature Pack -->
<div v-if="is.windows">
<div v-if="!requirements.windows.media"
class="notification notification--warning">
<span class="icon"><font-awesome-icon icon="exclamation-triangle" /></span>
<span>
The <strong>Windows Media Feature Pack</strong> is not installed.
You can <a href="https://www.microsoft.com/en-us/software-download/mediafeaturepack"
target="_blank">install it</a> or ignore this warning.
</span>
</div>
<div v-else
class="notification notification--success">
<span class="icon"><font-awesome-icon icon="check-circle" /></span>
<span>The Windows Media Feature Pack is installed.</span>
</div>
</div>

<div v-if="hasAlerts"
class="legend">
<p>
<strong class="text-warning-400"><font-awesome-icon icon="exclamation-triangle" /></strong> = It could cause problems.
</p>

<p>
<strong class="text-danger-400"><font-awesome-icon icon="exclamation-triangle" /></strong> = It will cause problems.
</p>
</div>
</div>
</div>
</template>

<script>
import { requirements } from '~/modules/system'

const { is } = $provider.util

export default {
data: () => ({
requirements,
is,
}),

computed: {
hasAlerts() {
return requirements.hasAlerts
},
},
}
</script>

<style lang="scss" scoped>
.alerts {
.legend {
@apply text-sm mt-6;
}
}
</style>

+ 33
- 0
src/pages/settings/app.vue View File

@@ -20,6 +20,34 @@
</template>
</PageHeader>

<div class="alerts">
<!-- Models Folder -->
<div v-if="!requirements.folders.models" class="notification notification--danger">
<span class="icon"><font-awesome-icon icon="exclamation-triangle" /></span>
<span v-if="!$dream.isPortable">
The <strong>Models</strong> folder has <strong>invalid characters</strong>. <nuxt-link to="/settings/folders">Please change the location of the folder.</nuxt-link>
</span>
<span v-else>
The place where you have extracted {{ $dream.name }} has <strong>invalid characters</strong>.
Please move the application to another place.
</span>
</div>

<!-- GPU -->
<div v-if="$settings.preferences.advanced.device === 'GPU'">
<div v-if="!requirements.recommended.vram" class="notification notification--warning">
<span class="icon"><font-awesome-icon icon="exclamation-triangle" /></span>
<span>Your NVIDIA GPU has very low VRAM! The algorithm is very likely to fail.</span>
</div>
</div>

<!-- RAM -->
<div v-if="!requirements.recommended.ram" class="notification notification--warning">
<span class="icon"><font-awesome-icon icon="exclamation-triangle" /></span>
<span>Your system has less than <strong>12 GB</strong> of RAM.</span>
</div>
</div>

<section class="box">
<div class="box__content">
<SettingsField field-id="app.disableHardwareAcceleration" />
@@ -54,10 +82,15 @@
<script>
import { VModel } from '~/mixins'
import { events } from '~/modules'
import { requirements } from '~/modules/system'

export default {
mixins: [VModel],

data: () => ({
requirements,
}),

methods: {
openDevTools() {
const mainWindow = require('electron').remote.BrowserWindow.getAllWindows()[0]

+ 10
- 4
src/pages/settings/processing.vue View File

@@ -13,17 +13,23 @@

<section class="box">
<div class="box__content">
<SettingsField v-if="!isMacOS" v-model="value$" field-id="processing.device" />
<SettingsField v-if="!isMacOS"
v-model="value$"
field-id="preferences.advanced.device"
ignore-hardcoded />

<SettingsField v-else field-id="processing.device" description="Mac only supports CPU.">
<select v-model="value$.processing.device" class="input" disabled>
<SettingsField v-else
field-id="preferences.advanced.device"
description="Mac only supports CPU."
ignore-hardcoded>
<select v-model="value$.preferences.advanced.device" class="input" disabled>
<option value="CPU">
CPU
</option>
</select>
</SettingsField>

<SettingsField v-show="value$.processing.device === 'GPU'" field-id="processing.gpus">
<SettingsField v-show="value$.preferences.advanced.device === 'GPU'" field-id="processing.gpus">
<select v-model="value$.processing.gpus[0]" class="input">
<option v-for="(device, index) in $provider.system.graphics" :key="index" :value="index">
{{ device.model }}

+ 15
- 1
src/pages/settings/share.vue View File

@@ -103,6 +103,10 @@

<SettingsField v-model="importPreferences" field-id="preferences.advanced.scaleMode" readonly />

<SettingsField v-model="importPreferences" field-id="preferences.advanced.imageSize" readonly />

<SettingsField v-model="importPreferences" field-id="preferences.advanced.compress" readonly />

<SettingsField v-model="importPreferences" field-id="preferences.advanced.useColorPaddingStrip" readonly />

<SettingsField v-model="importPreferences" field-id="preferences.advanced.useColorTransfer" readonly />
@@ -270,7 +274,11 @@ export default {
allowEscapeKey: false,
})

delete this.preferences.advanced.waifu.enabled
try {
delete this.preferences.advanced.waifu.enabled
delete this.preferences.advanced.device
// eslint-disable-next-line no-empty
} catch (e) { }

this.$dreamtrack.channel.emit('preferencesExport', this.preferences)
},
@@ -298,6 +306,12 @@ export default {
},

reviewImport() {
try {
delete this.importPreferences.advanced.waifu.enabled
delete this.importPreferences.advanced.device
// eslint-disable-next-line no-empty
} catch (e) { }

this.value$.preferences = merge(this.value$.preferences, this.importPreferences)

Swal.fire({

+ 5
- 2
src/pages/wizard/power.vue View File

@@ -37,9 +37,12 @@
</AppBox>

<AppBox title="Settings.">
<SettingsField v-if="!isMacOS" field-id="processing.device" @change="$dreampower.updater.refresh()" />
<SettingsField v-if="!isMacOS"
field-id="preferences.advanced.device"
ignore-hardcoded
@change="$dreampower.updater.refresh()" />

<SettingsField v-else field-id="processing.device" description="Mac only supports CPU.">
<SettingsField v-else field-id="preferences.advanced.device" description="Mac only supports CPU.">
<select class="input" disabled>
<option value="CPU" selected>
CPU

+ 2
- 0
src/pages/wizard/tos.vue View File

@@ -47,6 +47,7 @@ export default {
</script>

<style lang="scss" scoped>
/* purgecss start ignore */
.tos {
&::v-deep {
.box__photo {
@@ -82,4 +83,5 @@ export default {
.tos__content {
@apply grid grid-cols-2 gap-6;
}
/* purgecss end ignore */
</style>

+ 8
- 2
src/plugins/boot.js View File

@@ -29,7 +29,10 @@ async function setupRemote() {
Promise.all([
rollbar.setup(),
logrocket.setup(),
]).catch(() => { })
]).catch((error) => {
// eslint-disable-next-line no-console
console.warn(error)
})

// Projects.
await Promise.all([
@@ -38,7 +41,10 @@ async function setupRemote() {
waifu.init(),
checkpoints.init(),
community.init(),
]).catch(() => { })
]).catch((error) => {
// eslint-disable-next-line no-console
console.warn(error)
})
}

/**

+ 12
- 3
src/tailwind.config.js View File

@@ -1,8 +1,5 @@
// See default config https://github.com/tailwindcss/tailwindcss/blob/master/stubs/defaultConfig.stub.js
module.exports = {
purge: {
enabled: false,
},
theme: {
spacing: {
px: '1px',
@@ -213,6 +210,18 @@ module.exports = {
},
}),
],
purge: {
// https://tailwindcss.com/docs/controlling-file-size/#removing-unused-css
enabled: true,
content: [
'components/**/*.vue',
'layouts/**/*.vue',
'pages/**/*.vue',
'plugins/**/*.js',
'modules/**/*.js',
'nuxt.config.js',
],
},
corePlugins: {
container: false,
},

+ 3
- 2
src/workers/fs/worker.js View File

@@ -24,13 +24,13 @@ async function getMetadata(filepath) {
const exists = existsSync(filepath)

const workload = [
readFile(filepath, { encoding: 'base64' }),
Promise.resolve(mime.lookup(filepath)),
Promise.resolve(parse(filepath)),
]

if (exists) {
workload.push(
readFile(filepath, { encoding: 'base64' }),
stat(filepath),
md5File(filepath),
)
@@ -38,13 +38,14 @@ async function getMetadata(filepath) {
workload.push(
Promise.resolve(),
Promise.resolve(),
Promise.resolve(),
)
}

const [
base64,
mimetype,
{ name, ext, dir },
base64,
stats,
md5,
] = await Promise.all(workload)

Loading…
Cancel
Save