Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -175,7 +175,9 @@ color_checkboxes = {}
|
|
| 175 |
color_sliders = {}
|
| 176 |
|
| 177 |
# Set up the Gradio interface
|
| 178 |
-
#
|
|
|
|
|
|
|
| 179 |
color_checkboxes = {color: gr.Checkbox(label=f"{color} Selected", value=False) for color in color_attributes}
|
| 180 |
color_sliders = {color: gr.Slider(label=f"{color} Influence Ratio", minimum=0, maximum=1, step=0.01, value=0) for color in color_attributes}
|
| 181 |
|
|
@@ -205,7 +207,6 @@ with gr.Blocks() as demo:
|
|
| 205 |
inference_steps = gr.Slider(minimum=4, maximum=20, label="Inference Steps", value=4)
|
| 206 |
randomize_seed = gr.Checkbox(label="Randomize Seed", value=True)
|
| 207 |
|
| 208 |
-
# Set examples for predefined prompts
|
| 209 |
gr.Examples(
|
| 210 |
examples=examples,
|
| 211 |
inputs=prompt,
|
|
@@ -220,22 +221,22 @@ with gr.Blocks() as demo:
|
|
| 220 |
outputs=negative_prompt,
|
| 221 |
)
|
| 222 |
|
| 223 |
-
#
|
| 224 |
-
generate_inputs =
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
# Connect the UI with the generate function
|
| 239 |
run_button.click(
|
| 240 |
fn=generate,
|
| 241 |
inputs=generate_inputs,
|
|
|
|
| 175 |
color_sliders = {}
|
| 176 |
|
| 177 |
# Set up the Gradio interface
|
| 178 |
+
# Assuming the generate function and other necessary imports and initializations are already defined
|
| 179 |
+
|
| 180 |
+
# Initialize dynamic UI components for color influences
|
| 181 |
color_checkboxes = {color: gr.Checkbox(label=f"{color} Selected", value=False) for color in color_attributes}
|
| 182 |
color_sliders = {color: gr.Slider(label=f"{color} Influence Ratio", minimum=0, maximum=1, step=0.01, value=0) for color in color_attributes}
|
| 183 |
|
|
|
|
| 207 |
inference_steps = gr.Slider(minimum=4, maximum=20, label="Inference Steps", value=4)
|
| 208 |
randomize_seed = gr.Checkbox(label="Randomize Seed", value=True)
|
| 209 |
|
|
|
|
| 210 |
gr.Examples(
|
| 211 |
examples=examples,
|
| 212 |
inputs=prompt,
|
|
|
|
| 221 |
outputs=negative_prompt,
|
| 222 |
)
|
| 223 |
|
| 224 |
+
# List of inputs for the generate function
|
| 225 |
+
generate_inputs = [
|
| 226 |
+
prompt,
|
| 227 |
+
negative_prompt,
|
| 228 |
+
style_selection,
|
| 229 |
+
use_negative_prompt,
|
| 230 |
+
seed,
|
| 231 |
+
width,
|
| 232 |
+
height,
|
| 233 |
+
inference_steps,
|
| 234 |
+
randomize_seed,
|
| 235 |
+
*[color_checkboxes[color] for color in color_attributes],
|
| 236 |
+
*[color_sliders[color] for color in color_attributes]
|
| 237 |
+
]
|
| 238 |
+
|
| 239 |
+
# Connect the UI with the generate function using the run_button click
|
| 240 |
run_button.click(
|
| 241 |
fn=generate,
|
| 242 |
inputs=generate_inputs,
|