Spaces:
Sleeping
Sleeping
Commit
·
1dc07b0
1
Parent(s):
8f792e9
updated cfg range for sd1.5
Browse files- src/sdgen/ui/layout.py +13 -5
src/sdgen/ui/layout.py
CHANGED
|
@@ -43,8 +43,14 @@ def _resolve_seed(value: Any) -> int | None:
|
|
| 43 |
def _update_steps_and_cfg(model):
|
| 44 |
"""Upate steps based on the model."""
|
| 45 |
if model == "Turbo":
|
| 46 |
-
return (
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
|
| 50 |
def _txt2img_handler(
|
|
@@ -195,7 +201,8 @@ def build_ui(txt2img_pipes: dict, img2img_pipes: dict) -> gr.Blocks:
|
|
| 195 |
with gr.Blocks() as demo:
|
| 196 |
gr.Markdown(
|
| 197 |
"# Stable Diffusion Generator\n"
|
| 198 |
-
"Generation can take from few seconds to several minutes based
|
|
|
|
| 199 |
)
|
| 200 |
|
| 201 |
model_choice = gr.Dropdown(
|
|
@@ -242,8 +249,9 @@ def build_ui(txt2img_pipes: dict, img2img_pipes: dict) -> gr.Blocks:
|
|
| 242 |
"### Notes\n"
|
| 243 |
"- Use **History → Refresh** if new entries do not appear.\n"
|
| 244 |
"- Presets apply to both **Text → Image** and \
|
| 245 |
-
|
| 246 |
-
"- This app is hosted on CPU based HF Spaces, so generation may
|
|
|
|
| 247 |
)
|
| 248 |
|
| 249 |
return demo
|
|
|
|
| 43 |
def _update_steps_and_cfg(model):
|
| 44 |
"""Upate steps based on the model."""
|
| 45 |
if model == "Turbo":
|
| 46 |
+
return (
|
| 47 |
+
gr.update(minimum=1, maximum=5, value=2, step=1),
|
| 48 |
+
gr.update(minimum=0, maximum=0, value=0, step=0),
|
| 49 |
+
)
|
| 50 |
+
return (
|
| 51 |
+
gr.update(minimum=10, maximum=30, value=20, step=1),
|
| 52 |
+
gr.update(minimum=1, maximum=10, value=5, step=1),
|
| 53 |
+
)
|
| 54 |
|
| 55 |
|
| 56 |
def _txt2img_handler(
|
|
|
|
| 201 |
with gr.Blocks() as demo:
|
| 202 |
gr.Markdown(
|
| 203 |
"# Stable Diffusion Generator\n"
|
| 204 |
+
"Generation can take from few seconds to several minutes based \
|
| 205 |
+
on the Model selceted and applied settings."
|
| 206 |
)
|
| 207 |
|
| 208 |
model_choice = gr.Dropdown(
|
|
|
|
| 249 |
"### Notes\n"
|
| 250 |
"- Use **History → Refresh** if new entries do not appear.\n"
|
| 251 |
"- Presets apply to both **Text → Image** and \
|
| 252 |
+
**Image → Image** tabs.\n"
|
| 253 |
+
"- This app is hosted on CPU based HF Spaces, so generation may \
|
| 254 |
+
take some time, please be patient.\n"
|
| 255 |
)
|
| 256 |
|
| 257 |
return demo
|