From 417abe9b8f9f6ddc1d17424d5748f6302f983e1c Mon Sep 17 00:00:00 2001 From: ShyVortex Date: Tue, 30 Jul 2024 11:42:51 +0200 Subject: [PATCH 1/9] Update generate view - Renamed 'Style' to 'Model' in Generate - Added the option to select Stable Diffusion 3 as a generative model - Renamed 'generate.py' to 'generate_sd2-1.py' --- .idea/misc.xml | 5 +---- .../controller/DiffusionController.java | 19 ++++++++++--------- .../{generate.py => generate_sd2-1.py} | 0 src/main/resources/app-generate-view.fxml | 8 ++++---- 4 files changed, 15 insertions(+), 17 deletions(-) rename src/main/python/it/unimol/diffusiontool/{generate.py => generate_sd2-1.py} (100%) diff --git a/.idea/misc.xml b/.idea/misc.xml index 54b799f..db3b44c 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,11 +1,8 @@ + - - diff --git a/src/main/java/it/unimol/diffusiontool/controller/DiffusionController.java b/src/main/java/it/unimol/diffusiontool/controller/DiffusionController.java index 48b7818..39fec4b 100644 --- a/src/main/java/it/unimol/diffusiontool/controller/DiffusionController.java +++ b/src/main/java/it/unimol/diffusiontool/controller/DiffusionController.java @@ -252,11 +252,12 @@ private void initGenerateView() { profilePicProperty.set(diffApp.getUser().getProfilePic()); homeUserImage.imageProperty().bind(profilePicProperty); styleComboBox.getItems().addAll( - "General", + "Stable Diffusion 2.1", + "Stable Diffusion 3", "Pixel Art" ); styleComboBox.setPromptText(styleComboBox.getItems().get(0)); - styleComboBox.setValue("General"); + styleComboBox.setValue("Stable Diffusion 2.1"); } @FXML @@ -588,10 +589,10 @@ private void OnProfileDeleteClick() throws Exception { @FXML private void OnStyleSelect() { - if (styleComboBox.getValue().equals("General")) - upscaleCheckBox.setVisible(true); - else - upscaleCheckBox.setVisible(false); + // Upscaling checkbox only visible if selected model is SD2.1 + upscaleCheckBox.setVisible( + styleComboBox.getValue().equals("Stable Diffusion 2.1") + ); } @FXML @@ -1219,9 +1220,9 @@ public File findPyScript() { String fileName; switch (pythonCalledBy) { case 1: - if (styleComboBox.getValue().equals("General")) - // if (includeUpscaling) -> generate_upscale.py, else -> generate.py - fileName = includeUpscaling ? "generate_upscale.py" : "generate.py"; + if (styleComboBox.getValue().equals("Stable Diffusion 2.1")) + // if (includeUpscaling) -> generate_upscale.py, else -> generate_sd2-1.py + fileName = includeUpscaling ? "generate_upscale.py" : "generate_sd2-1.py"; else fileName = "generate_pixart.py"; break; diff --git a/src/main/python/it/unimol/diffusiontool/generate.py b/src/main/python/it/unimol/diffusiontool/generate_sd2-1.py similarity index 100% rename from src/main/python/it/unimol/diffusiontool/generate.py rename to src/main/python/it/unimol/diffusiontool/generate_sd2-1.py diff --git a/src/main/resources/app-generate-view.fxml b/src/main/resources/app-generate-view.fxml index 29e9a94..985d57a 100644 --- a/src/main/resources/app-generate-view.fxml +++ b/src/main/resources/app-generate-view.fxml @@ -14,8 +14,8 @@ - @@ -75,12 +75,12 @@