Skip to content

Commit

Permalink
feat: live painting config (#54)
Browse files Browse the repository at this point in the history
## Motivation
remaps folder structure
provides additional path helpers

## Issues closed

<!-- List closed issues here -->
  • Loading branch information
pixelass authored Feb 22, 2024
1 parent 159bdb8 commit d9f311d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion resources/python/live-painting/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def warmup(pipe, input_image_path):

def main(pipe, input_image_path, output_image_path, shutdown_event):
# Initial/default values for parameters
prompt = "realistic face, 4k"
prompt = "a person, incredible watercolor paining"
seed = 1
strength = 0.99
guidance_scale = None
Expand Down
17 changes: 11 additions & 6 deletions src/electron/future/ipc/listeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import { execa } from "execa";
import { buildKey } from "#/build-key";
import { DownloadState, ID } from "#/enums";
import { appSettingsStore, userStore } from "@/stores";
import { getCaptainData, getCaptainDownloads, getDirectory } from "@/utils/path-helpers";
import {
getCaptainData,
getCaptainDownloads,
getCaptainTemporary,
getDirectory,
} from "@/utils/path-helpers";
import { unpack } from "@/utils/unpack";

ipcMain.on(buildKey([ID.WINDOW], { suffix: ":close" }), () => {
Expand Down Expand Up @@ -107,15 +112,15 @@ ipcMain.on(buildKey([ID.LIVE_PAINT], { suffix: ":start" }), () => {
const scriptPath = getDirectory("python/live-painting/main.py");
const scriptArguments = [
"--model_path",
getCaptainData("downloads/stable-diffusion/checkpoint/sd-turbo/"),
getCaptainDownloads("stable-diffusion/checkpoints/stabilityai/sd-turbo"),
"--vae_path",
getCaptainData("downloads/stable-diffusion/vae/taesd/"),
getCaptainDownloads("stable-diffusion/vae/madebyollin/taesd"),
"--input_image_path",
getCaptainData("temp/live-painting/input.png"),
getCaptainTemporary("live-painting/input.png"),
"--output_image_path",
getCaptainData("temp/live-painting/output.png"),
getCaptainTemporary("live-painting/output.png"),
"--disable_stablefast",
// "--debug",
"--debug",
];

process = execa(pythonBinaryPath, ["-u", scriptPath, ...scriptArguments]);
Expand Down
4 changes: 4 additions & 0 deletions src/electron/future/utils/path-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ export function getCaptainData(...subpath: string[]): string {
export function getCaptainDownloads(...subpath: string[]): string {
return getCaptainData("downloads", ...subpath);
}

export function getCaptainTemporary(...subpath: string[]): string {
return getCaptainData("temp", ...subpath);
}

0 comments on commit d9f311d

Please sign in to comment.