radames HF staff commited on
Commit
350d95c
1 Parent(s): 0ce3ca4

better defaults for canny sliders

Browse files
Files changed (1) hide show
  1. app.py +27 -13
app.py CHANGED
@@ -90,9 +90,9 @@ def predict(
90
  prompt,
91
  negative_prompt,
92
  seed,
93
- controlnet_conditioning_scale,
94
  guidance_scale=8.5,
95
  scale=2,
 
96
  strength=1.0,
97
  controlnet_start=0.0,
98
  controlnet_end=1.0,
@@ -228,7 +228,7 @@ SDXL Controlnet [TheMistoAI/MistoLine](https://huggingface.co/TheMistoAI/MistoLi
228
  value=0.0,
229
  label="Canny Low Threshold",
230
  )
231
- controlnet_end = gr.Slider(
232
  minimum=0.0,
233
  maximum=1.0,
234
  step=0.001,
@@ -248,95 +248,109 @@ SDXL Controlnet [TheMistoAI/MistoLine](https://huggingface.co/TheMistoAI/MistoLi
248
  prompt,
249
  negative_prompt,
250
  seed,
251
- controlnet_conditioning_scale,
252
  guidance_scale,
253
  scale,
 
254
  strength,
255
  controlnet_start,
256
  controlnet_end,
 
 
257
  ]
258
  outputs = [image_slider, padded_image, canny_image]
259
  btn.click(lambda x: None, inputs=None, outputs=image_slider).then(
260
- predict, inputs=inputs, outputs=outputs, concurrency_limit=1
261
  )
262
  gr.Examples(
263
  fn=predict,
 
 
264
  examples=[
265
  [
266
  "./examples/lara.jpeg",
267
  "photography of lara croft 8k high definition award winning",
268
  "blurry, ugly, duplicate, poorly drawn, deformed, mosaic",
269
  5436236241,
270
- 0.5,
271
  8.5,
272
  2,
273
  0.8,
 
274
  0.0,
275
  1.0,
 
 
276
  ],
277
  [
278
  "./examples/cybetruck.jpeg",
279
  "photo of tesla cybertruck futuristic car 8k high definition on a sand dune in mars, future",
280
  "blurry, ugly, duplicate, poorly drawn, deformed, mosaic",
281
  383472451451,
282
- 0.5,
283
  8.5,
284
  2,
285
  0.8,
 
286
  0.0,
287
  1.0,
 
 
288
  ],
289
  [
290
  "./examples/jesus.png",
291
  "a photorealistic painting of Jesus Christ, 4k high definition",
292
  "blurry, ugly, duplicate, poorly drawn, deformed, mosaic",
293
  13317204146129588000,
294
- 0.5,
295
  8.5,
296
  2,
297
  0.8,
 
298
  0.0,
299
  1.0,
 
 
300
  ],
301
  [
302
  "./examples/anna-sullivan-DioLM8ViiO8-unsplash.jpg",
303
  "A crowded stadium with enthusiastic fans watching a daytime sporting event, the stands filled with colorful attire and the sun casting a warm glow",
304
  "blurry, ugly, duplicate, poorly drawn, deformed, mosaic",
305
  5623124123512,
306
- 0.5,
307
  8.5,
308
  2,
309
  0.8,
 
310
  0.0,
311
  1.0,
 
 
312
  ],
313
  [
314
  "./examples/img_aef651cb-2919-499d-aa49-6d4e2e21a56e_1024.jpg",
315
  "a large red flower on a black background 4k high definition",
316
  "blurry, ugly, duplicate, poorly drawn, deformed, mosaic",
317
  23123412341234,
318
- 0.5,
319
  8.5,
320
  2,
321
  0.8,
 
322
  0.0,
323
  1.0,
 
 
324
  ],
325
  [
326
  "./examples/huggingface.jpg",
327
  "photo realistic huggingface human emoji costume, round, yellow, (human skin)+++ (human texture)+++",
328
  "blurry, ugly, duplicate, poorly drawn, deformed, mosaic, emoji cartoon, drawing, pixelated",
329
  12312353423,
330
- 0.101,
331
- 25.206,
332
  2,
 
333
  0.8,
334
  0.0,
335
  1.0,
 
 
336
  ],
337
  ],
338
- inputs=inputs,
339
- outputs=outputs,
340
  cache_examples="lazy",
341
  )
342
 
 
90
  prompt,
91
  negative_prompt,
92
  seed,
 
93
  guidance_scale=8.5,
94
  scale=2,
95
+ controlnet_conditioning_scale=0.5,
96
  strength=1.0,
97
  controlnet_start=0.0,
98
  controlnet_end=1.0,
 
228
  value=0.0,
229
  label="Canny Low Threshold",
230
  )
231
+ canny_high = gr.Slider(
232
  minimum=0.0,
233
  maximum=1.0,
234
  step=0.001,
 
248
  prompt,
249
  negative_prompt,
250
  seed,
 
251
  guidance_scale,
252
  scale,
253
+ controlnet_conditioning_scale,
254
  strength,
255
  controlnet_start,
256
  controlnet_end,
257
+ canny_low,
258
+ canny_high,
259
  ]
260
  outputs = [image_slider, padded_image, canny_image]
261
  btn.click(lambda x: None, inputs=None, outputs=image_slider).then(
262
+ fn=predict, inputs=inputs, outputs=outputs
263
  )
264
  gr.Examples(
265
  fn=predict,
266
+ inputs=inputs,
267
+ outputs=outputs,
268
  examples=[
269
  [
270
  "./examples/lara.jpeg",
271
  "photography of lara croft 8k high definition award winning",
272
  "blurry, ugly, duplicate, poorly drawn, deformed, mosaic",
273
  5436236241,
 
274
  8.5,
275
  2,
276
  0.8,
277
+ 1.0,
278
  0.0,
279
  1.0,
280
+ 0.01,
281
+ 0.2,
282
  ],
283
  [
284
  "./examples/cybetruck.jpeg",
285
  "photo of tesla cybertruck futuristic car 8k high definition on a sand dune in mars, future",
286
  "blurry, ugly, duplicate, poorly drawn, deformed, mosaic",
287
  383472451451,
 
288
  8.5,
289
  2,
290
  0.8,
291
+ 0.8,
292
  0.0,
293
  1.0,
294
+ 0.01,
295
+ 0.2,
296
  ],
297
  [
298
  "./examples/jesus.png",
299
  "a photorealistic painting of Jesus Christ, 4k high definition",
300
  "blurry, ugly, duplicate, poorly drawn, deformed, mosaic",
301
  13317204146129588000,
 
302
  8.5,
303
  2,
304
  0.8,
305
+ 0.8,
306
  0.0,
307
  1.0,
308
+ 0.01,
309
+ 0.2,
310
  ],
311
  [
312
  "./examples/anna-sullivan-DioLM8ViiO8-unsplash.jpg",
313
  "A crowded stadium with enthusiastic fans watching a daytime sporting event, the stands filled with colorful attire and the sun casting a warm glow",
314
  "blurry, ugly, duplicate, poorly drawn, deformed, mosaic",
315
  5623124123512,
 
316
  8.5,
317
  2,
318
  0.8,
319
+ 0.8,
320
  0.0,
321
  1.0,
322
+ 0.01,
323
+ 0.2,
324
  ],
325
  [
326
  "./examples/img_aef651cb-2919-499d-aa49-6d4e2e21a56e_1024.jpg",
327
  "a large red flower on a black background 4k high definition",
328
  "blurry, ugly, duplicate, poorly drawn, deformed, mosaic",
329
  23123412341234,
 
330
  8.5,
331
  2,
332
  0.8,
333
+ 0.8,
334
  0.0,
335
  1.0,
336
+ 0.01,
337
+ 0.2,
338
  ],
339
  [
340
  "./examples/huggingface.jpg",
341
  "photo realistic huggingface human emoji costume, round, yellow, (human skin)+++ (human texture)+++",
342
  "blurry, ugly, duplicate, poorly drawn, deformed, mosaic, emoji cartoon, drawing, pixelated",
343
  12312353423,
344
+ 15.206,
 
345
  2,
346
+ 0.364,
347
  0.8,
348
  0.0,
349
  1.0,
350
+ 0.0,
351
+ 0.95,
352
  ],
353
  ],
 
 
354
  cache_examples="lazy",
355
  )
356