Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
import requests
|
3 |
import io
|
@@ -79,6 +80,8 @@ API_TOKEN = os.getenv("HF_READ_TOKEN")
|
|
79 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
80 |
timeout = 100
|
81 |
|
|
|
|
|
82 |
def flip_image(x):
|
83 |
return np.fliplr(x)
|
84 |
|
@@ -122,6 +125,7 @@ def query(lora_id, prompt, is_negative=False, steps=28, cfg_scale=3.5, sampler="
|
|
122 |
"parameters": {
|
123 |
"width": width, # Pass the width to the API
|
124 |
"height": height # Pass the height to the API
|
|
|
125 |
}
|
126 |
}
|
127 |
|
@@ -200,6 +204,7 @@ with gr.Blocks(theme=theme, css=css, elem_id="app-container") as app:
|
|
200 |
cfg = gr.Slider(label="CFG Scale", value=3.5, minimum=1, maximum=20, step=0.5)
|
201 |
method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "DEIS", "LMS", "DPM Adaptive", "DPM++ 2M", "DPM2 Ancestral", "DPM++ S", "DPM++ SDE", "DDPM", "DPM Fast", "dpmpp_2s_ancestral", "Euler", "Euler CFG PP", "Euler a", "Euler Ancestral", "Euler+beta", "Heun", "Heun PP2", "DDIM", "PLMS", "UniPC", "UniPC BH2"])
|
202 |
strength = gr.Slider(label="Prompt Strength", value=100, minimum=0, maximum=100, step=1)
|
|
|
203 |
seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
|
204 |
with gr.Row():
|
205 |
with gr.Accordion("🫘Seed", open=False):
|
|
|
1 |
+
#!/usr/bin/env python
|
2 |
import gradio as gr
|
3 |
import requests
|
4 |
import io
|
|
|
80 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
81 |
timeout = 100
|
82 |
|
83 |
+
NUM_IMAGES_PER_PROMPT = 1
|
84 |
+
|
85 |
def flip_image(x):
|
86 |
return np.fliplr(x)
|
87 |
|
|
|
125 |
"parameters": {
|
126 |
"width": width, # Pass the width to the API
|
127 |
"height": height # Pass the height to the API
|
128 |
+
"num_images_per_prompt": NUM_IMAGES_PER_PROMPT,
|
129 |
}
|
130 |
}
|
131 |
|
|
|
204 |
cfg = gr.Slider(label="CFG Scale", value=3.5, minimum=1, maximum=20, step=0.5)
|
205 |
method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "DEIS", "LMS", "DPM Adaptive", "DPM++ 2M", "DPM2 Ancestral", "DPM++ S", "DPM++ SDE", "DDPM", "DPM Fast", "dpmpp_2s_ancestral", "Euler", "Euler CFG PP", "Euler a", "Euler Ancestral", "Euler+beta", "Heun", "Heun PP2", "DDIM", "PLMS", "UniPC", "UniPC BH2"])
|
206 |
strength = gr.Slider(label="Prompt Strength", value=100, minimum=0, maximum=100, step=1)
|
207 |
+
num_images_per_prompt = gr.Slider(label="Images", minimum=1, maximum=5, step=1, value=2, visible=True)
|
208 |
seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
|
209 |
with gr.Row():
|
210 |
with gr.Accordion("🫘Seed", open=False):
|