Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -93,6 +93,14 @@ def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, guidan
|
|
| 93 |
# Unload LoRA weights if they were loaded
|
| 94 |
if lora_id:
|
| 95 |
pipe.unload_lora_weights()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
examples = [
|
| 98 |
"a tiny astronaut hatching from an egg on the moon",
|
|
@@ -125,6 +133,17 @@ with gr.Blocks(css=css) as app:
|
|
| 125 |
text_prompt = gr.Textbox(label="Prompt", placeholder="Enter a prompt here", lines=3, elem_id="prompt-text-input")
|
| 126 |
with gr.Row():
|
| 127 |
custom_lora = gr.Textbox(label="Custom LoRA (optional)", info="URL or the path to the LoRA weights", placeholder="ostris/z_image_turbo_childrens_drawings")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
with gr.Row():
|
| 129 |
with gr.Accordion("Advanced Settings", open=False):
|
| 130 |
lora_scale = gr.Slider(
|
|
@@ -143,10 +162,6 @@ with gr.Blocks(css=css) as app:
|
|
| 143 |
steps = gr.Slider(label="Inference steps steps", value=9, minimum=1, maximum=20, step=1)
|
| 144 |
cfg = gr.Slider(label="Guidance Scale", value=0, minimum=0, maximum=20, step=0.5)
|
| 145 |
# method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "Euler", "Euler a", "Heun", "DDIM"])
|
| 146 |
-
|
| 147 |
-
with gr.Row():
|
| 148 |
-
# text_button = gr.Button("Run", variant='primary', elem_id="gen-button")
|
| 149 |
-
text_button = gr.Button("✨ Generate Image", variant='primary', elem_classes=["generate-btn"])
|
| 150 |
with gr.Column():
|
| 151 |
with gr.Row():
|
| 152 |
image_output = gr.Image(type="pil", label="Image Output", elem_id="gallery")
|
|
|
|
| 93 |
# Unload LoRA weights if they were loaded
|
| 94 |
if lora_id:
|
| 95 |
pipe.unload_lora_weights()
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
lora_examples = [
|
| 99 |
+
["ostris/z_image_turbo_childrens_drawings"],
|
| 100 |
+
["tarn59/pixel_art_style_lora_z_image_turbo"],
|
| 101 |
+
["renderartist/Saturday-Morning-Z-Image-Turbo"],
|
| 102 |
+
["renderartist/Coloring-Book-Z-Image-Turbo-LoRA"],
|
| 103 |
+
]
|
| 104 |
|
| 105 |
examples = [
|
| 106 |
"a tiny astronaut hatching from an egg on the moon",
|
|
|
|
| 133 |
text_prompt = gr.Textbox(label="Prompt", placeholder="Enter a prompt here", lines=3, elem_id="prompt-text-input")
|
| 134 |
with gr.Row():
|
| 135 |
custom_lora = gr.Textbox(label="Custom LoRA (optional)", info="URL or the path to the LoRA weights", placeholder="ostris/z_image_turbo_childrens_drawings")
|
| 136 |
+
gr.Examples(
|
| 137 |
+
examples=lora_examples,
|
| 138 |
+
inputs=[custom_lora],
|
| 139 |
+
label="or Select a LoRA Model",
|
| 140 |
+
)
|
| 141 |
+
|
| 142 |
+
|
| 143 |
+
with gr.Row():
|
| 144 |
+
# text_button = gr.Button("Run", variant='primary', elem_id="gen-button")
|
| 145 |
+
text_button = gr.Button("✨ Generate Image", variant='primary', elem_classes=["generate-btn"])
|
| 146 |
+
|
| 147 |
with gr.Row():
|
| 148 |
with gr.Accordion("Advanced Settings", open=False):
|
| 149 |
lora_scale = gr.Slider(
|
|
|
|
| 162 |
steps = gr.Slider(label="Inference steps steps", value=9, minimum=1, maximum=20, step=1)
|
| 163 |
cfg = gr.Slider(label="Guidance Scale", value=0, minimum=0, maximum=20, step=0.5)
|
| 164 |
# method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "Euler", "Euler a", "Heun", "DDIM"])
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
with gr.Column():
|
| 166 |
with gr.Row():
|
| 167 |
image_output = gr.Image(type="pil", label="Image Output", elem_id="gallery")
|