Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"tauri": "tauri",
"check": "svelte-check --tsconfig ./tsconfig.json"
},
"devDependencies": {
Expand All @@ -26,6 +27,7 @@
},
"dependencies": {
"@tauri-apps/api": "^1.0.2",
"@tauri-apps/cli": "^1.0.5",
"tauri-settings": "^0.1.2"
}
}
7 changes: 5 additions & 2 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ fn main() {
.add_native_item(MenuItem::Copy)
.add_native_item(MenuItem::Paste)
.add_native_item(MenuItem::Cut)
.add_native_item(MenuItem::SelectAll)
.add_native_item(MenuItem::Undo)
.add_native_item(MenuItem::Redo)
.add_item(CustomMenuItem::new("hide", "Hide"))
.add_submenu(submenu);

Expand All @@ -38,9 +41,9 @@ fn main() {
}

#[tauri::command]
async fn stable_diffusion_command(command: String) -> String {
async fn stable_diffusion_command(directory: String, command: String) -> String {
// let stable_diffusion_directory = Path::new("/Users/zagreus/code/ml/stable-diffusion");
let stable_diffusion_directory = "/Users/zagreus/code/ml/stable-diffusion";
let stable_diffusion_directory = directory; // "/Users/zagreus/code/ml/stable-diffusion";
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just embarrassing. I totally didn't mean to leave this hardcoded 😛

let virtual_env_cmd = "venv/bin/activate";

println!("Stable Diffusion directory: {}", stable_diffusion_directory);
Expand Down
5 changes: 3 additions & 2 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
--ddim_steps 100 (1m) 2m on M1 Pro
*/
let stableDiffusionDirectoryInput: HTMLInputElement;
let stableDiffusionDirectory: string = "";
$: stableDiffusionDirectory = "";
let stableDiffusionOutputDirectory: string = "";
let stableDiffusionCommand: string = "";
let stableDiffusionCommandHtml: string = "";
Expand Down Expand Up @@ -92,6 +92,7 @@

// Invoke the Stable Diffusion command
await invoke("stable_diffusion_command", {
directory: stableDiffusionDirectory,
command: stableDiffusionCommand,
})
.then((res) => {
Expand Down Expand Up @@ -126,7 +127,7 @@
});
</script>

<main class="flex flex-col gap-8">
<main class="flex flex-col gap-8 text-black">
<div class="flex flex-col gap-2">
<div class="flex gap-2">
<input
Expand Down
Loading