kadirnar commited on
Commit
739cb0d
1 Parent(s): 3f7d745

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +97 -97
app.py CHANGED
@@ -193,28 +193,28 @@ with app:
193
 
194
  with gr.Tab('ControlNet'):
195
  with gr.Tab('Canny'):
196
- controlnet_image_file = gr.Image(label='Image')
197
 
198
- controlnet_model_id = gr.Dropdown(
199
  choices=stable_model_list,
200
  value=stable_model_list[0],
201
  label='Stable Model Id'
202
  )
203
 
204
- controlnet_prompt = gr.Textbox(
205
  lines=1,
206
  value=stable_prompt_list[0],
207
  label='Prompt'
208
  )
209
 
210
- controlnet_negative_prompt = gr.Textbox(
211
  lines=1,
212
  value=stable_negative_prompt_list[0],
213
  label='Negative Prompt'
214
  )
215
 
216
  with gr.Accordion("Advanced Options", open=False):
217
- controlnet_guidance_scale = gr.Slider(
218
  minimum=0.1,
219
  maximum=15,
220
  step=0.1,
@@ -222,7 +222,7 @@ with app:
222
  label='Guidance Scale'
223
  )
224
 
225
- controlnet_num_inference_step = gr.Slider(
226
  minimum=1,
227
  maximum=100,
228
  step=1,
@@ -233,28 +233,28 @@ with app:
233
  controlnet_canny_predict = gr.Button(value='Generator')
234
 
235
  with gr.Tab('Hed'):
236
- controlnet_image_file = gr.Image(label='Image')
237
 
238
- controlnet_model_id = gr.Dropdown(
239
- choices=stable_inpiant_model_list,
240
- value=stable_inpiant_model_list[0],
241
  label='Stable Model Id'
242
  )
243
 
244
- controlnet_prompt = gr.Textbox(
245
  lines=1,
246
  value=stable_prompt_list[0],
247
  label='Prompt'
248
  )
249
 
250
- controlnet_negative_prompt = gr.Textbox(
251
  lines=1,
252
  value=stable_negative_prompt_list[0],
253
  label='Negative Prompt'
254
  )
255
 
256
  with gr.Accordion("Advanced Options", open=False):
257
- controlnet_guidance_scale = gr.Slider(
258
  minimum=0.1,
259
  maximum=15,
260
  step=0.1,
@@ -262,7 +262,7 @@ with app:
262
  label='Guidance Scale'
263
  )
264
 
265
- controlnet_num_inference_step = gr.Slider(
266
  minimum=1,
267
  maximum=100,
268
  step=1,
@@ -273,28 +273,28 @@ with app:
273
  controlnet_hed_predict = gr.Button(value='Generator')
274
 
275
  with gr.Tab('MLSD line'):
276
- controlnet_image_file = gr.Image(label='Image')
277
 
278
- controlnet_model_id = gr.Dropdown(
279
- choices=stable_inpiant_model_list,
280
- value=stable_inpiant_model_list[0],
281
  label='Stable Model Id'
282
  )
283
 
284
- controlnet_prompt = gr.Textbox(
285
  lines=1,
286
  value=stable_prompt_list[0],
287
  label='Prompt'
288
  )
289
 
290
- controlnet_negative_prompt = gr.Textbox(
291
  lines=1,
292
  value=stable_negative_prompt_list[0],
293
  label='Negative Prompt'
294
  )
295
 
296
  with gr.Accordion("Advanced Options", open=False):
297
- controlnet_guidance_scale = gr.Slider(
298
  minimum=0.1,
299
  maximum=15,
300
  step=0.1,
@@ -302,7 +302,7 @@ with app:
302
  label='Guidance Scale'
303
  )
304
 
305
- controlnet_num_inference_step = gr.Slider(
306
  minimum=1,
307
  maximum=100,
308
  step=1,
@@ -313,28 +313,28 @@ with app:
313
  controlnet_mlsd_predict = gr.Button(value='Generator')
314
 
315
  with gr.Tab('Segmentation'):
316
- controlnet_image_file = gr.Image(label='Image')
317
 
318
- controlnet_model_id = gr.Dropdown(
319
- choices=stable_inpiant_model_list,
320
- value=stable_inpiant_model_list[0],
321
  label='Stable Model Id'
322
  )
323
 
324
- controlnet_prompt = gr.Textbox(
325
  lines=1,
326
  value=stable_prompt_list[0],
327
  label='Prompt'
328
  )
329
 
330
- controlnet_negative_prompt = gr.Textbox(
331
  lines=1,
332
  value=stable_negative_prompt_list[0],
333
  label='Negative Prompt'
334
  )
335
 
336
  with gr.Accordion("Advanced Options", open=False):
337
- controlnet_guidance_scale = gr.Slider(
338
  minimum=0.1,
339
  maximum=15,
340
  step=0.1,
@@ -342,7 +342,7 @@ with app:
342
  label='Guidance Scale'
343
  )
344
 
345
- controlnet_num_inference_step = gr.Slider(
346
  minimum=1,
347
  maximum=100,
348
  step=1,
@@ -353,28 +353,28 @@ with app:
353
  controlnet_seg_predict = gr.Button(value='Generator')
354
 
355
  with gr.Tab('Depth'):
356
- controlnet_image_file = gr.Image(label='Image')
357
 
358
- controlnet_model_id = gr.Dropdown(
359
- choices=stable_inpiant_model_list,
360
- value=stable_inpiant_model_list[0],
361
  label='Stable Model Id'
362
  )
363
 
364
- controlnet_prompt = gr.Textbox(
365
  lines=1,
366
  value=stable_prompt_list[0],
367
  label='Prompt'
368
  )
369
 
370
- controlnet_negative_prompt = gr.Textbox(
371
  lines=1,
372
  value=stable_negative_prompt_list[0],
373
  label='Negative Prompt'
374
  )
375
 
376
  with gr.Accordion("Advanced Options", open=False):
377
- controlnet_guidance_scale = gr.Slider(
378
  minimum=0.1,
379
  maximum=15,
380
  step=0.1,
@@ -382,7 +382,7 @@ with app:
382
  label='Guidance Scale'
383
  )
384
 
385
- controlnet_num_inference_step = gr.Slider(
386
  minimum=1,
387
  maximum=100,
388
  step=1,
@@ -393,28 +393,28 @@ with app:
393
  controlnet_depth_predict = gr.Button(value='Generator')
394
 
395
  with gr.Tab('Scribble'):
396
- controlnet_image_file = gr.Image(label='Image')
397
 
398
- controlnet_model_id = gr.Dropdown(
399
- choices=stable_inpiant_model_list,
400
- value=stable_inpiant_model_list[0],
401
  label='Stable Model Id'
402
  )
403
 
404
- controlnet_prompt = gr.Textbox(
405
  lines=1,
406
  value=stable_prompt_list[0],
407
  label='Prompt'
408
  )
409
 
410
- controlnet_negative_prompt = gr.Textbox(
411
  lines=1,
412
  value=stable_negative_prompt_list[0],
413
  label='Negative Prompt'
414
  )
415
 
416
  with gr.Accordion("Advanced Options", open=False):
417
- controlnet_guidance_scale = gr.Slider(
418
  minimum=0.1,
419
  maximum=15,
420
  step=0.1,
@@ -422,7 +422,7 @@ with app:
422
  label='Guidance Scale'
423
  )
424
 
425
- controlnet_num_inference_step = gr.Slider(
426
  minimum=1,
427
  maximum=100,
428
  step=1,
@@ -433,28 +433,28 @@ with app:
433
  controlnet_scribble_predict = gr.Button(value='Generator')
434
 
435
  with gr.Tab('Pose'):
436
- controlnet_image_file = gr.Image(label='Image')
437
 
438
- controlnet_model_id = gr.Dropdown(
439
- choices=stable_inpiant_model_list,
440
- value=stable_inpiant_model_list[0],
441
  label='Stable Model Id'
442
  )
443
 
444
- controlnet_prompt = gr.Textbox(
445
  lines=1,
446
  value=stable_prompt_list[0],
447
  label='Prompt'
448
  )
449
 
450
- controlnet_negative_prompt = gr.Textbox(
451
  lines=1,
452
  value=stable_negative_prompt_list[0],
453
  label='Negative Prompt'
454
  )
455
 
456
  with gr.Accordion("Advanced Options", open=False):
457
- controlnet_guidance_scale = gr.Slider(
458
  minimum=0.1,
459
  maximum=15,
460
  step=0.1,
@@ -462,7 +462,7 @@ with app:
462
  label='Guidance Scale'
463
  )
464
 
465
- controlnet_num_inference_step = gr.Slider(
466
  minimum=1,
467
  maximum=100,
468
  step=1,
@@ -520,12 +520,12 @@ with app:
520
  controlnet_canny_predict.click(
521
  fn = stable_diffusion_controlnet_img2img,
522
  inputs = [
523
- controlnet_image_file,
524
- controlnet_model_id,
525
- controlnet_prompt,
526
- controlnet_negative_prompt,
527
- controlnet_guidance_scale,
528
- controlnet_num_inference_step,
529
  ],
530
  outputs = [output_image],
531
  )
@@ -533,12 +533,12 @@ with app:
533
  controlnet_hed_predict.click(
534
  fn = stable_diffusion_controlnet_img2img,
535
  inputs = [
536
- controlnet_image_file,
537
- controlnet_model_id,
538
- controlnet_prompt,
539
- controlnet_negative_prompt,
540
- controlnet_guidance_scale,
541
- controlnet_num_inference_step,
542
  ],
543
  outputs = [output_image],
544
  )
@@ -546,12 +546,12 @@ with app:
546
  controlnet_mlsd_predict.click(
547
  fn = stable_diffusion_controlnet_img2img,
548
  inputs = [
549
- controlnet_image_file,
550
- controlnet_model_id,
551
- controlnet_prompt,
552
- controlnet_negative_prompt,
553
- controlnet_guidance_scale,
554
- controlnet_num_inference_step,
555
  ],
556
  outputs = [output_image],
557
  )
@@ -559,12 +559,12 @@ with app:
559
  controlnet_seg_predict.click(
560
  fn = stable_diffusion_controlnet_img2img,
561
  inputs = [
562
- controlnet_image_file,
563
- controlnet_model_id,
564
- controlnet_prompt,
565
- controlnet_negative_prompt,
566
- controlnet_guidance_scale,
567
- controlnet_num_inference_step,
568
  ],
569
  outputs = [output_image],
570
  )
@@ -572,12 +572,12 @@ with app:
572
  controlnet_depth_predict.click(
573
  fn = stable_diffusion_controlnet_img2img,
574
  inputs = [
575
- controlnet_image_file,
576
- controlnet_model_id,
577
- controlnet_prompt,
578
- controlnet_negative_prompt,
579
- controlnet_guidance_scale,
580
- controlnet_num_inference_step,
581
  ],
582
  outputs = [output_image],
583
  )
@@ -585,12 +585,12 @@ with app:
585
  controlnet_scribble_predict.click(
586
  fn = stable_diffusion_controlnet_img2img,
587
  inputs = [
588
- controlnet_image_file,
589
- controlnet_model_id,
590
- controlnet_prompt,
591
- controlnet_negative_prompt,
592
- controlnet_guidance_scale,
593
- controlnet_num_inference_step,
594
  ],
595
  outputs = [output_image],
596
  )
@@ -598,14 +598,14 @@ with app:
598
  controlnet_pose_predict.click(
599
  fn = stable_diffusion_controlnet_img2img,
600
  inputs = [
601
- controlnet_image_file,
602
- controlnet_model_id,
603
- controlnet_prompt,
604
- controlnet_negative_prompt,
605
- controlnet_guidance_scale,
606
- controlnet_num_inference_step,
607
  ],
608
  outputs = [output_image],
609
- )
610
 
611
  app.launch()
 
193
 
194
  with gr.Tab('ControlNet'):
195
  with gr.Tab('Canny'):
196
+ controlnet_canny_image_file = gr.Image(label='Image')
197
 
198
+ controlnet_canny_model_id = gr.Dropdown(
199
  choices=stable_model_list,
200
  value=stable_model_list[0],
201
  label='Stable Model Id'
202
  )
203
 
204
+ controlnet_canny_prompt = gr.Textbox(
205
  lines=1,
206
  value=stable_prompt_list[0],
207
  label='Prompt'
208
  )
209
 
210
+ controlnet_canny_negative_prompt = gr.Textbox(
211
  lines=1,
212
  value=stable_negative_prompt_list[0],
213
  label='Negative Prompt'
214
  )
215
 
216
  with gr.Accordion("Advanced Options", open=False):
217
+ controlnet_canny_guidance_scale = gr.Slider(
218
  minimum=0.1,
219
  maximum=15,
220
  step=0.1,
 
222
  label='Guidance Scale'
223
  )
224
 
225
+ controlnet_canny_num_inference_step = gr.Slider(
226
  minimum=1,
227
  maximum=100,
228
  step=1,
 
233
  controlnet_canny_predict = gr.Button(value='Generator')
234
 
235
  with gr.Tab('Hed'):
236
+ controlnet_hed_image_file = gr.Image(label='Image')
237
 
238
+ controlnet_hed_model_id = gr.Dropdown(
239
+ choices=stable_prompt_list,
240
+ value=stable_prompt_list[0],
241
  label='Stable Model Id'
242
  )
243
 
244
+ controlnet_hed_prompt = gr.Textbox(
245
  lines=1,
246
  value=stable_prompt_list[0],
247
  label='Prompt'
248
  )
249
 
250
+ controlnet_hed_negative_prompt = gr.Textbox(
251
  lines=1,
252
  value=stable_negative_prompt_list[0],
253
  label='Negative Prompt'
254
  )
255
 
256
  with gr.Accordion("Advanced Options", open=False):
257
+ controlnet_hed_guidance_scale = gr.Slider(
258
  minimum=0.1,
259
  maximum=15,
260
  step=0.1,
 
262
  label='Guidance Scale'
263
  )
264
 
265
+ controlnet_hed_num_inference_step = gr.Slider(
266
  minimum=1,
267
  maximum=100,
268
  step=1,
 
273
  controlnet_hed_predict = gr.Button(value='Generator')
274
 
275
  with gr.Tab('MLSD line'):
276
+ controlnet_mlsd_image_file = gr.Image(label='Image')
277
 
278
+ controlnet_mlsd_model_id = gr.Dropdown(
279
+ choices=stable_prompt_list,
280
+ value=stable_prompt_list[0],
281
  label='Stable Model Id'
282
  )
283
 
284
+ controlnet_mlsd_prompt = gr.Textbox(
285
  lines=1,
286
  value=stable_prompt_list[0],
287
  label='Prompt'
288
  )
289
 
290
+ controlnet_mlsd_negative_prompt = gr.Textbox(
291
  lines=1,
292
  value=stable_negative_prompt_list[0],
293
  label='Negative Prompt'
294
  )
295
 
296
  with gr.Accordion("Advanced Options", open=False):
297
+ controlnet_mlsd_guidance_scale = gr.Slider(
298
  minimum=0.1,
299
  maximum=15,
300
  step=0.1,
 
302
  label='Guidance Scale'
303
  )
304
 
305
+ controlnet_mlsd_num_inference_step = gr.Slider(
306
  minimum=1,
307
  maximum=100,
308
  step=1,
 
313
  controlnet_mlsd_predict = gr.Button(value='Generator')
314
 
315
  with gr.Tab('Segmentation'):
316
+ controlnet_seg_image_file = gr.Image(label='Image')
317
 
318
+ controlnet_seg_model_id = gr.Dropdown(
319
+ choices=stable_prompt_list,
320
+ value=stable_prompt_list[0],
321
  label='Stable Model Id'
322
  )
323
 
324
+ controlnet_seg_prompt = gr.Textbox(
325
  lines=1,
326
  value=stable_prompt_list[0],
327
  label='Prompt'
328
  )
329
 
330
+ controlnet_seg_negative_prompt = gr.Textbox(
331
  lines=1,
332
  value=stable_negative_prompt_list[0],
333
  label='Negative Prompt'
334
  )
335
 
336
  with gr.Accordion("Advanced Options", open=False):
337
+ controlnet_seg_guidance_scale = gr.Slider(
338
  minimum=0.1,
339
  maximum=15,
340
  step=0.1,
 
342
  label='Guidance Scale'
343
  )
344
 
345
+ controlnet_seg_num_inference_step = gr.Slider(
346
  minimum=1,
347
  maximum=100,
348
  step=1,
 
353
  controlnet_seg_predict = gr.Button(value='Generator')
354
 
355
  with gr.Tab('Depth'):
356
+ controlnet_depth_image_file = gr.Image(label='Image')
357
 
358
+ controlnet_depth_model_id = gr.Dropdown(
359
+ choices=stable_prompt_list,
360
+ value=stable_prompt_list[0],
361
  label='Stable Model Id'
362
  )
363
 
364
+ controlnet_depth_prompt = gr.Textbox(
365
  lines=1,
366
  value=stable_prompt_list[0],
367
  label='Prompt'
368
  )
369
 
370
+ controlnet_depth_negative_prompt = gr.Textbox(
371
  lines=1,
372
  value=stable_negative_prompt_list[0],
373
  label='Negative Prompt'
374
  )
375
 
376
  with gr.Accordion("Advanced Options", open=False):
377
+ controlnet_depth_guidance_scale = gr.Slider(
378
  minimum=0.1,
379
  maximum=15,
380
  step=0.1,
 
382
  label='Guidance Scale'
383
  )
384
 
385
+ controlnet_depth_num_inference_step = gr.Slider(
386
  minimum=1,
387
  maximum=100,
388
  step=1,
 
393
  controlnet_depth_predict = gr.Button(value='Generator')
394
 
395
  with gr.Tab('Scribble'):
396
+ controlnet_scribble_image_file = gr.Image(label='Image')
397
 
398
+ controlnet_scribble_model_id = gr.Dropdown(
399
+ choices=stable_prompt_list,
400
+ value=stable_prompt_list[0],
401
  label='Stable Model Id'
402
  )
403
 
404
+ controlnet_scribble_prompt = gr.Textbox(
405
  lines=1,
406
  value=stable_prompt_list[0],
407
  label='Prompt'
408
  )
409
 
410
+ controlnet_scribble_negative_prompt = gr.Textbox(
411
  lines=1,
412
  value=stable_negative_prompt_list[0],
413
  label='Negative Prompt'
414
  )
415
 
416
  with gr.Accordion("Advanced Options", open=False):
417
+ controlnet_scribble_guidance_scale = gr.Slider(
418
  minimum=0.1,
419
  maximum=15,
420
  step=0.1,
 
422
  label='Guidance Scale'
423
  )
424
 
425
+ controlnet_scribble_num_inference_step = gr.Slider(
426
  minimum=1,
427
  maximum=100,
428
  step=1,
 
433
  controlnet_scribble_predict = gr.Button(value='Generator')
434
 
435
  with gr.Tab('Pose'):
436
+ controlnet_pose_image_file = gr.Image(label='Image')
437
 
438
+ controlnet_pose_model_id = gr.Dropdown(
439
+ choices=stable_prompt_list,
440
+ value=stable_prompt_list[0],
441
  label='Stable Model Id'
442
  )
443
 
444
+ controlnet_pose_prompt = gr.Textbox(
445
  lines=1,
446
  value=stable_prompt_list[0],
447
  label='Prompt'
448
  )
449
 
450
+ controlnet_pose_negative_prompt = gr.Textbox(
451
  lines=1,
452
  value=stable_negative_prompt_list[0],
453
  label='Negative Prompt'
454
  )
455
 
456
  with gr.Accordion("Advanced Options", open=False):
457
+ controlnet_pose_guidance_scale = gr.Slider(
458
  minimum=0.1,
459
  maximum=15,
460
  step=0.1,
 
462
  label='Guidance Scale'
463
  )
464
 
465
+ controlnet_pose_num_inference_step = gr.Slider(
466
  minimum=1,
467
  maximum=100,
468
  step=1,
 
520
  controlnet_canny_predict.click(
521
  fn = stable_diffusion_controlnet_img2img,
522
  inputs = [
523
+ controlnet_canny_image_file,
524
+ controlnet_canny_model_id,
525
+ controlnet_canny_prompt,
526
+ controlnet_canny_negative_prompt,
527
+ controlnet_canny_guidance_scale,
528
+ controlnet_canny_num_inference_step,
529
  ],
530
  outputs = [output_image],
531
  )
 
533
  controlnet_hed_predict.click(
534
  fn = stable_diffusion_controlnet_img2img,
535
  inputs = [
536
+ controlnet_hed_image_file,
537
+ controlnet_hed_model_id,
538
+ controlnet_hed_prompt,
539
+ controlnet_hed_negative_prompt,
540
+ controlnet_hed_guidance_scale,
541
+ controlnet_hed_num_inference_step,
542
  ],
543
  outputs = [output_image],
544
  )
 
546
  controlnet_mlsd_predict.click(
547
  fn = stable_diffusion_controlnet_img2img,
548
  inputs = [
549
+ controlnet_mlsd_image_file,
550
+ controlnet_mlsd_model_id,
551
+ controlnet_mlsd_prompt,
552
+ controlnet_mlsd_negative_prompt,
553
+ controlnet_mlsd_guidance_scale,
554
+ controlnet_mlsd_num_inference_step,
555
  ],
556
  outputs = [output_image],
557
  )
 
559
  controlnet_seg_predict.click(
560
  fn = stable_diffusion_controlnet_img2img,
561
  inputs = [
562
+ controlnet_seg_image_file,
563
+ controlnet_seg_model_id,
564
+ controlnet_seg_prompt,
565
+ controlnet_seg_negative_prompt,
566
+ controlnet_seg_guidance_scale,
567
+ controlnet_seg_num_inference_step,
568
  ],
569
  outputs = [output_image],
570
  )
 
572
  controlnet_depth_predict.click(
573
  fn = stable_diffusion_controlnet_img2img,
574
  inputs = [
575
+ controlnet_depth_image_file,
576
+ controlnet_depth_model_id,
577
+ controlnet_depth_prompt,
578
+ controlnet_depth_negative_prompt,
579
+ controlnet_depth_guidance_scale,
580
+ controlnet_depth_num_inference_step,
581
  ],
582
  outputs = [output_image],
583
  )
 
585
  controlnet_scribble_predict.click(
586
  fn = stable_diffusion_controlnet_img2img,
587
  inputs = [
588
+ controlnet_scribble_image_file,
589
+ controlnet_scribble_model_id,
590
+ controlnet_scribble_prompt,
591
+ controlnet_scribble_negative_prompt,
592
+ controlnet_scribble_guidance_scale,
593
+ controlnet_scribble_num_inference_step,
594
  ],
595
  outputs = [output_image],
596
  )
 
598
  controlnet_pose_predict.click(
599
  fn = stable_diffusion_controlnet_img2img,
600
  inputs = [
601
+ controlnet_pose_image_file,
602
+ controlnet_pose_model_id,
603
+ controlnet_pose_prompt,
604
+ controlnet_pose_negative_prompt,
605
+ controlnet_pose_guidance_scale,
606
+ controlnet_pose_num_inference_step,
607
  ],
608
  outputs = [output_image],
609
+ )
610
 
611
  app.launch()