Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -181,7 +181,7 @@ valid_models = [
|
|
| 181 |
model_management.load_models_gpu(valid_models)
|
| 182 |
|
| 183 |
@spaces.GPU
|
| 184 |
-
def generate_image(prompt,
|
| 185 |
with torch.inference_mode():
|
| 186 |
# Set random seed if provided
|
| 187 |
if seed == -1:
|
|
@@ -247,7 +247,7 @@ with gr.Blocks() as app:
|
|
| 247 |
|
| 248 |
Model: [Chroma](https://huggingface.co/lodestones/Chroma) by [lodestones](https://huggingface.co/lodestones)
|
| 249 |
|
| 250 |
-
|
| 251 |
|
| 252 |
Run any ComfyUI Workflow on Spaces: [ComfyUI Workflows](https://huggingface.co/blog/run-comfyui-workflows-on-spaces)
|
| 253 |
|
|
@@ -261,12 +261,6 @@ Space Author: [GitHub](https://github.com/gokayfem) | [X.com](https://x.com/goka
|
|
| 261 |
placeholder="Enter your prompt here...",
|
| 262 |
lines=3
|
| 263 |
)
|
| 264 |
-
negative_prompt = gr.Textbox(
|
| 265 |
-
label="Negative Prompt",
|
| 266 |
-
placeholder="Enter negative prompt here...",
|
| 267 |
-
value="low quality, ugly, unfinished, out of focus, deformed, disfigure, blurry, smudged, restricted palette, flat colors",
|
| 268 |
-
lines=2
|
| 269 |
-
)
|
| 270 |
|
| 271 |
with gr.Row():
|
| 272 |
width = gr.Slider(
|
|
@@ -292,13 +286,6 @@ Space Author: [GitHub](https://github.com/gokayfem) | [X.com](https://x.com/goka
|
|
| 292 |
step=1,
|
| 293 |
label="Steps"
|
| 294 |
)
|
| 295 |
-
cfg = gr.Slider(
|
| 296 |
-
minimum=0.1,
|
| 297 |
-
maximum=4,
|
| 298 |
-
value=1,
|
| 299 |
-
step=0.1,
|
| 300 |
-
label="CFG Scale"
|
| 301 |
-
)
|
| 302 |
seed = gr.Number(
|
| 303 |
value=-1,
|
| 304 |
label="Seed (-1 for random)"
|
|
@@ -311,14 +298,14 @@ Space Author: [GitHub](https://github.com/gokayfem) | [X.com](https://x.com/goka
|
|
| 311 |
|
| 312 |
generate_btn.click(
|
| 313 |
fn=generate_image,
|
| 314 |
-
inputs=[prompt,
|
| 315 |
outputs=[output_image]
|
| 316 |
)
|
| 317 |
|
| 318 |
# Add examples section
|
| 319 |
gr.Examples(
|
| 320 |
examples=EXAMPLES,
|
| 321 |
-
inputs=[prompt,
|
| 322 |
outputs=[output_image],
|
| 323 |
fn=generate_image,
|
| 324 |
cache_examples=True,
|
|
|
|
| 181 |
model_management.load_models_gpu(valid_models)
|
| 182 |
|
| 183 |
@spaces.GPU
|
| 184 |
+
def generate_image(prompt, width, height, steps, seed):
|
| 185 |
with torch.inference_mode():
|
| 186 |
# Set random seed if provided
|
| 187 |
if seed == -1:
|
|
|
|
| 247 |
|
| 248 |
Model: [Chroma](https://huggingface.co/lodestones/Chroma) by [lodestones](https://huggingface.co/lodestones)
|
| 249 |
|
| 250 |
+
Chroma1-HD-flash-heun : {CHROMA_VERSION}
|
| 251 |
|
| 252 |
Run any ComfyUI Workflow on Spaces: [ComfyUI Workflows](https://huggingface.co/blog/run-comfyui-workflows-on-spaces)
|
| 253 |
|
|
|
|
| 261 |
placeholder="Enter your prompt here...",
|
| 262 |
lines=3
|
| 263 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 264 |
|
| 265 |
with gr.Row():
|
| 266 |
width = gr.Slider(
|
|
|
|
| 286 |
step=1,
|
| 287 |
label="Steps"
|
| 288 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 289 |
seed = gr.Number(
|
| 290 |
value=-1,
|
| 291 |
label="Seed (-1 for random)"
|
|
|
|
| 298 |
|
| 299 |
generate_btn.click(
|
| 300 |
fn=generate_image,
|
| 301 |
+
inputs=[prompt, width, height, steps, seed],
|
| 302 |
outputs=[output_image]
|
| 303 |
)
|
| 304 |
|
| 305 |
# Add examples section
|
| 306 |
gr.Examples(
|
| 307 |
examples=EXAMPLES,
|
| 308 |
+
inputs=[prompt, width, height, steps, seed],
|
| 309 |
outputs=[output_image],
|
| 310 |
fn=generate_image,
|
| 311 |
cache_examples=True,
|