Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
|
| 16 |
timeout = 100
|
| 17 |
|
| 18 |
# Function to query the API and return the generated image
|
| 19 |
-
def query(prompt, is_negative=False, steps=
|
| 20 |
if prompt == "" or prompt is None:
|
| 21 |
return None
|
| 22 |
|
|
@@ -76,7 +76,7 @@ css = """
|
|
| 76 |
"""
|
| 77 |
|
| 78 |
# Build the Gradio UI with Blocks
|
| 79 |
-
with gr.Blocks(theme='
|
| 80 |
# Add a title to the app
|
| 81 |
gr.HTML("<center><h1>Text-To-Image</h1></center>")
|
| 82 |
|
|
@@ -99,7 +99,7 @@ with gr.Blocks(theme='Nymbo/Nymbo_Theme', css=css) as app:
|
|
| 99 |
cfg = gr.Slider(label="CFG Scale", value=7, minimum=1, maximum=20, step=1)
|
| 100 |
strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
|
| 101 |
seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1) # Setting the seed to -1 will make it random
|
| 102 |
-
method = gr.Radio(label="Sampling method", value="DPM++
|
| 103 |
|
| 104 |
# Add a button to trigger the image generation
|
| 105 |
with gr.Row():
|
|
|
|
| 16 |
timeout = 100
|
| 17 |
|
| 18 |
# Function to query the API and return the generated image
|
| 19 |
+
def query(prompt, is_negative=False, steps=25, cfg_scale=7, sampler="DPM++ SDE Karras", seed=-1, strength=0.7, width=256, height=256):
|
| 20 |
if prompt == "" or prompt is None:
|
| 21 |
return None
|
| 22 |
|
|
|
|
| 76 |
"""
|
| 77 |
|
| 78 |
# Build the Gradio UI with Blocks
|
| 79 |
+
with gr.Blocks(theme='', css=css) as app:
|
| 80 |
# Add a title to the app
|
| 81 |
gr.HTML("<center><h1>Text-To-Image</h1></center>")
|
| 82 |
|
|
|
|
| 99 |
cfg = gr.Slider(label="CFG Scale", value=7, minimum=1, maximum=20, step=1)
|
| 100 |
strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
|
| 101 |
seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1) # Setting the seed to -1 will make it random
|
| 102 |
+
method = gr.Radio(label="Sampling method", value="DPM++ SDE Karras", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "Euler", "Euler a", "Heun", "DDIM"])
|
| 103 |
|
| 104 |
# Add a button to trigger the image generation
|
| 105 |
with gr.Row():
|