Spaces:
Sleeping
Sleeping
fixed
Browse files
app.py
CHANGED
@@ -90,21 +90,20 @@ def generate(
|
|
90 |
|
91 |
if mode == "Generate":
|
92 |
file["none"] = ""
|
93 |
-
if model == "Ultra":
|
94 |
url = model_url["ImageUltra"]
|
95 |
-
elif model == "Core":
|
96 |
url = model_url["ImageCore"]
|
97 |
data["style_preset"] = preset
|
98 |
-
|
99 |
-
elif model == "sd3-medium":
|
100 |
url = model_url["StableDiffusion3"]
|
101 |
-
data["model"] =
|
102 |
-
elif model == "
|
103 |
url = model_url["StableDiffusion3"]
|
104 |
-
data["model"] =
|
105 |
-
elif model == "
|
106 |
url = model_url["StableDiffusion3"]
|
107 |
-
data["model"] =
|
108 |
|
109 |
else:
|
110 |
raise ValueError("Invalid model type")
|
@@ -189,7 +188,7 @@ css = """
|
|
189 |
|
190 |
|
191 |
def update_style_visibility(model):
|
192 |
-
if model == "Core":
|
193 |
return gr.update(visible=True)
|
194 |
else:
|
195 |
return gr.update(visible=False)
|
@@ -285,7 +284,7 @@ with gr.Blocks(css=css, theme="NoCrypt/miku") as demo:
|
|
285 |
with gr.Row():
|
286 |
model = gr.Dropdown(
|
287 |
label="Model",
|
288 |
-
choices=["Ultra", "Core", "
|
289 |
value="Ultra",
|
290 |
)
|
291 |
mode = gr.Dropdown(
|
@@ -444,9 +443,9 @@ with gr.Blocks(css=css, theme="NoCrypt/miku") as demo:
|
|
444 |
[cc-by-nc-image]: https://licensebuttons.net/l/by-nc/4.0/88x31.png
|
445 |
[cc-by-nc-shield]: https://img.shields.io/badge/License-CC%20BY--NC%204.0-lightgrey.svg
|
446 |
|
447 |
-
|
448 |
-
Portions of this work are licensed under the MIT License. For more details, please refer to the original source at
|
449 |
-
[stabilityai/stable-diffusion-3-medium]
|
450 |
"""
|
451 |
)
|
452 |
gr.on(
|
|
|
90 |
|
91 |
if mode == "Generate":
|
92 |
file["none"] = ""
|
93 |
+
if model == "Stable Image Ultra (8B + workflow)":
|
94 |
url = model_url["ImageUltra"]
|
95 |
+
elif model == "Stable Image Core (2B + workflow)":
|
96 |
url = model_url["ImageCore"]
|
97 |
data["style_preset"] = preset
|
98 |
+
elif model == "Stable Diffusion 3 Medium (2B)":
|
|
|
99 |
url = model_url["StableDiffusion3"]
|
100 |
+
data["model"] = "sd3-medium"
|
101 |
+
elif model == "Stable Diffusion 3 Large (8B)":
|
102 |
url = model_url["StableDiffusion3"]
|
103 |
+
data["model"] = "sd3-large"
|
104 |
+
elif model == "Stable Diffusion 3 Large Turbo (8B Turbo)":
|
105 |
url = model_url["StableDiffusion3"]
|
106 |
+
data["model"] = "sd3-large-turbo"
|
107 |
|
108 |
else:
|
109 |
raise ValueError("Invalid model type")
|
|
|
188 |
|
189 |
|
190 |
def update_style_visibility(model):
|
191 |
+
if model == "Stable Image Core (2B + workflow)":
|
192 |
return gr.update(visible=True)
|
193 |
else:
|
194 |
return gr.update(visible=False)
|
|
|
284 |
with gr.Row():
|
285 |
model = gr.Dropdown(
|
286 |
label="Model",
|
287 |
+
choices=["Stable Image Ultra (8B + workflow)", "Stable Image Core (2B + workflow)", "Stable Diffusion 3 Large Turbo (8B Turbo)", "Stable Diffusion 3 Large (8B)", "Stable Diffusion 3 Medium (2B)"],
|
288 |
value="Ultra",
|
289 |
)
|
290 |
mode = gr.Dropdown(
|
|
|
443 |
[cc-by-nc-image]: https://licensebuttons.net/l/by-nc/4.0/88x31.png
|
444 |
[cc-by-nc-shield]: https://img.shields.io/badge/License-CC%20BY--NC%204.0-lightgrey.svg
|
445 |
|
446 |
+
**MIT Licensed Source Code**
|
447 |
+
Portions of this work are licensed under the MIT License. For more details, please refer to the original source at:
|
448 |
+
[stabilityai/stable-diffusion-3-medium](https://huggingface.co/spaces/stabilityai/stable-diffusion-3-medium)
|
449 |
"""
|
450 |
)
|
451 |
gr.on(
|