Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -186,22 +186,23 @@ with gr.Blocks() as blocks:
|
|
| 186 |
interactive=False,
|
| 187 |
info="Whether init image should be QR code. Unclick to pass init image or generate init image with Stable Diffusion 2.1"
|
| 188 |
)
|
| 189 |
-
with gr.Accordion(label="Init Images (Optional)", open=False, visible=
|
| 190 |
init_image = gr.Image(label="Init Image (Optional). Leave blank to generate image with AI", type="pil")
|
| 191 |
|
| 192 |
|
| 193 |
-
with gr.Accordion("Advanced Artistic Controls", open=
|
| 194 |
controlnet_conditioning_scale = gr.Slider(
|
| 195 |
minimum=0.0,
|
| 196 |
maximum=5.0,
|
| 197 |
step=0.01,
|
| 198 |
value=1.1,
|
| 199 |
label="QR Code Visibility",
|
| 200 |
-
info="""
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
|
|
|
| 205 |
)
|
| 206 |
strength = gr.Slider(
|
| 207 |
minimum=0.0,
|
|
@@ -209,11 +210,12 @@ with gr.Blocks() as blocks:
|
|
| 209 |
step=0.01,
|
| 210 |
value=0.9,
|
| 211 |
label="Artistic Freedom",
|
| 212 |
-
info="""
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
|
|
|
| 217 |
)
|
| 218 |
guidance_scale = gr.Slider(
|
| 219 |
minimum=0.0,
|
|
@@ -221,21 +223,23 @@ with gr.Blocks() as blocks:
|
|
| 221 |
step=0.25,
|
| 222 |
value=7.5,
|
| 223 |
label="Prompt Adherence",
|
| 224 |
-
info="""
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
|
|
|
| 229 |
)
|
| 230 |
sampler = gr.Dropdown(
|
| 231 |
choices=list(SAMPLER_MAP.keys()),
|
| 232 |
value="DPM++ Karras SDE",
|
| 233 |
label="Image Generation Technique",
|
| 234 |
-
info="""
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
|
|
|
| 239 |
)
|
| 240 |
seed = gr.Slider(
|
| 241 |
minimum=-1,
|
|
@@ -243,10 +247,11 @@ with gr.Blocks() as blocks:
|
|
| 243 |
step=1,
|
| 244 |
value=-1,
|
| 245 |
label="Creative Seed",
|
| 246 |
-
info="""
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
|
|
|
| 250 |
randomize=False,
|
| 251 |
)
|
| 252 |
with gr.Row():
|
|
@@ -345,4 +350,4 @@ with gr.Blocks() as blocks:
|
|
| 345 |
)
|
| 346 |
|
| 347 |
blocks.queue(max_size=20,api_open=False)
|
| 348 |
-
blocks.launch(share=bool(os.environ.get("SHARE", False)), show_api=
|
|
|
|
| 186 |
interactive=False,
|
| 187 |
info="Whether init image should be QR code. Unclick to pass init image or generate init image with Stable Diffusion 2.1"
|
| 188 |
)
|
| 189 |
+
with gr.Accordion(label="Init Images (Optional)", open=False, visible=True) as init_image_acc:
|
| 190 |
init_image = gr.Image(label="Init Image (Optional). Leave blank to generate image with AI", type="pil")
|
| 191 |
|
| 192 |
|
| 193 |
+
with gr.Accordion("Advanced Artistic Controls", open=True):
|
| 194 |
controlnet_conditioning_scale = gr.Slider(
|
| 195 |
minimum=0.0,
|
| 196 |
maximum=5.0,
|
| 197 |
step=0.01,
|
| 198 |
value=1.1,
|
| 199 |
label="QR Code Visibility",
|
| 200 |
+
info="""
|
| 201 |
+
Balance between QR code clarity and artistic integration:
|
| 202 |
+
<p>• Lower (0.0-0.5): Subtle, may be hard to scan</p>
|
| 203 |
+
<p>• Middle (0.6-1.5): Good blend of art and function</p>
|
| 204 |
+
<p>• Higher (1.6-5.0): Very clear QR code, less artistic freedom</p>
|
| 205 |
+
<p>Start at 1.1 and adjust to find your perfect balance.</p>"""
|
| 206 |
)
|
| 207 |
strength = gr.Slider(
|
| 208 |
minimum=0.0,
|
|
|
|
| 210 |
step=0.01,
|
| 211 |
value=0.9,
|
| 212 |
label="Artistic Freedom",
|
| 213 |
+
info="""
|
| 214 |
+
Controls how much the AI can alter the QR code:
|
| 215 |
+
<p>• Lower (0.0-0.3): Minimal changes, closer to standard QR</p>
|
| 216 |
+
<p>• Middle (0.4-0.7): Balanced artistic elements</p>
|
| 217 |
+
<p>• Higher (0.8-1.0): Maximum creativity, may affect scannability</p>
|
| 218 |
+
<p>Begin with 0.9 for a creative yet functional result.</p>"""
|
| 219 |
)
|
| 220 |
guidance_scale = gr.Slider(
|
| 221 |
minimum=0.0,
|
|
|
|
| 223 |
step=0.25,
|
| 224 |
value=7.5,
|
| 225 |
label="Prompt Adherence",
|
| 226 |
+
info="""
|
| 227 |
+
Determines how closely the AI follows your prompt:
|
| 228 |
+
<p>• Lower (0-5): More AI creativity, less prompt influence</p>
|
| 229 |
+
<p>• Middle (5-15): Balanced between prompt and AI interpretation</p>
|
| 230 |
+
<p>• Higher (15+): Strictly follows prompt, less variation</p>
|
| 231 |
+
<p>Start at 7.5 and adjust based on your desired outcome.</p>"""
|
| 232 |
)
|
| 233 |
sampler = gr.Dropdown(
|
| 234 |
choices=list(SAMPLER_MAP.keys()),
|
| 235 |
value="DPM++ Karras SDE",
|
| 236 |
label="Image Generation Technique",
|
| 237 |
+
info="""
|
| 238 |
+
Different methods for creating your QR art:
|
| 239 |
+
<p>• DPM++ Karras SDE: Versatile, high-quality results</p>
|
| 240 |
+
<p>• Euler: Sharp, detailed images</p>
|
| 241 |
+
<p>• DDIM: Good for abstract or artistic styles</p>
|
| 242 |
+
<p>Experiment to find what works best for your vision!</p>"""
|
| 243 |
)
|
| 244 |
seed = gr.Slider(
|
| 245 |
minimum=-1,
|
|
|
|
| 247 |
step=1,
|
| 248 |
value=-1,
|
| 249 |
label="Creative Seed",
|
| 250 |
+
info="""
|
| 251 |
+
Controls the randomness in art creation:
|
| 252 |
+
<p>• -1: New, unique creation each time</p>
|
| 253 |
+
<p>• Any other number: Recreates the same image consistently</p>
|
| 254 |
+
<p>Use -1 to explore, or set a specific number to refine a design you like.</p>""",
|
| 255 |
randomize=False,
|
| 256 |
)
|
| 257 |
with gr.Row():
|
|
|
|
| 350 |
)
|
| 351 |
|
| 352 |
blocks.queue(max_size=20,api_open=False)
|
| 353 |
+
blocks.launch(share=bool(os.environ.get("SHARE", False)), show_api=True)
|