pengdaqian commited on
Commit
3842624
1 Parent(s): 37db064
Files changed (1) hide show
  1. app.py +45 -57
app.py CHANGED
@@ -344,63 +344,51 @@ examples = list(map(lambda x: [
344
  ], word_list))[:500]
345
 
346
  with block:
 
 
 
 
 
 
 
 
347
  gr.HTML(
348
- """
349
- <div style="text-align: center; margin: 0 auto;">
350
- <div
351
- style="
352
- display: inline-flex;
353
- align-items: center;
354
- gap: 0.8rem;
355
- font-size: 1.75rem;
356
- "
357
- >
358
- <svg
359
- width="0.65em"
360
- height="0.65em"
361
- viewBox="0 0 115 115"
362
- fill="none"
363
- xmlns="http://www.w3.org/2000/svg"
364
- >
365
- <rect width="23" height="23" fill="white"></rect>
366
- <rect y="69" width="23" height="23" fill="white"></rect>
367
- <rect x="23" width="23" height="23" fill="#AEAEAE"></rect>
368
- <rect x="23" y="69" width="23" height="23" fill="#AEAEAE"></rect>
369
- <rect x="46" width="23" height="23" fill="white"></rect>
370
- <rect x="46" y="69" width="23" height="23" fill="white"></rect>
371
- <rect x="69" width="23" height="23" fill="black"></rect>
372
- <rect x="69" y="69" width="23" height="23" fill="black"></rect>
373
- <rect x="92" width="23" height="23" fill="#D9D9D9"></rect>
374
- <rect x="92" y="69" width="23" height="23" fill="#AEAEAE"></rect>
375
- <rect x="115" y="46" width="23" height="23" fill="white"></rect>
376
- <rect x="115" y="115" width="23" height="23" fill="white"></rect>
377
- <rect x="115" y="69" width="23" height="23" fill="#D9D9D9"></rect>
378
- <rect x="92" y="46" width="23" height="23" fill="#AEAEAE"></rect>
379
- <rect x="92" y="115" width="23" height="23" fill="#AEAEAE"></rect>
380
- <rect x="92" y="69" width="23" height="23" fill="white"></rect>
381
- <rect x="69" y="46" width="23" height="23" fill="white"></rect>
382
- <rect x="69" y="115" width="23" height="23" fill="white"></rect>
383
- <rect x="69" y="69" width="23" height="23" fill="#D9D9D9"></rect>
384
- <rect x="46" y="46" width="23" height="23" fill="black"></rect>
385
- <rect x="46" y="115" width="23" height="23" fill="black"></rect>
386
- <rect x="46" y="69" width="23" height="23" fill="black"></rect>
387
- <rect x="23" y="46" width="23" height="23" fill="#D9D9D9"></rect>
388
- <rect x="23" y="115" width="23" height="23" fill="#AEAEAE"></rect>
389
- <rect x="23" y="69" width="23" height="23" fill="black"></rect>
390
- </svg>
391
- <h1 style="font-weight: 900; margin-bottom: 7px;margin-top:5px">
392
- Stable Diffusion 2.1 Demo
393
- </h1>
394
- </div>
395
- <p style="margin-bottom: 10px; font-size: 94%; line-height: 23px;">
396
- small stable diffusion Demo App. <br />
397
- Click <strong>Generate image</strong> Button to generate image. <br />
398
- Also Change params to have a try <br />
399
- more size may cost more time. <br />
400
- It's just a simplified demo, you can use more advanced features optimize image quality <br />
401
- </p>
402
- </div>
403
- """
404
  )
405
  with gr.Group():
406
  with gr.Box():
@@ -484,7 +472,7 @@ with block:
484
  btn.click(infer, inputs=[text, negative, width, height, sampler, steps, seed, guidance_scale],
485
  outputs=[gallery], postprocess=False)
486
 
487
- block.queue(concurrency_count=80,
488
  max_size=100).launch(
489
  max_threads=150,
490
  # server_port=6006,
 
344
  ], word_list))[:500]
345
 
346
  with block:
347
+ title = "Stable Diffusion 2.1 Demo"
348
+ desc = """ small stable diffusion Demo App. <br />
349
+ Click <strong>Generate image</strong> Button to generate image. <br />
350
+ Also Change params to have a try <br />
351
+ more size may cost more time. <br />
352
+ It's just a simplified demo, you can use more advanced features optimize image quality <br />"""
353
+ tutorial_link = "https://docs.cworld.ai"
354
+
355
  gr.HTML(
356
+ f"""
357
+ <div style="text-align: center; margin: 0 auto;">
358
+ <div
359
+ style="
360
+ display: inline-flex;
361
+ align-items: center;
362
+ gap: 0.8rem;
363
+ font-size: 1.75rem;
364
+ "
365
+ >
366
+ <svg height="100%" stroke-miterlimit="10" style="fill-rule:nonzero;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;" version="1.1" viewBox="0 0 100 100" width="100%" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
367
+ <defs/>
368
+ <clipPath id="ArtboardFrame">
369
+ <rect height="100" width="100" x="0" y="0"/>
370
+ </clipPath>
371
+ <g clip-path="url(#ArtboardFrame)" id="SvgjsG2907">
372
+ <g opacity="1">
373
+ <g opacity="1">
374
+ <path d="M49.5597 6.74187C73.4486 6.74187 92.893 26.1863 92.893 50.0752C92.893 73.9641 73.4486 93.4085 49.5597 93.4085C25.6708 93.4085 6.22637 73.9641 6.22637 50.0752C6.22637 26.1863 25.6708 6.74187 49.5597 6.74187M49.5597 0.075206C21.893 0.075206-0.440293 22.4085-0.440293 50.0752C-0.440293 77.7419 21.893 100.075 49.5597 100.075C77.2264 100.075 99.5597 77.7419 99.5597 50.0752C99.5597 22.4085 77.2264 0.075206 49.5597 0.075206L49.5597 0.075206Z" fill="#111111" fill-rule="nonzero" opacity="1" stroke="none"/>
375
+ <path d="M55.1153 77.853L44.0042 77.853L44.0042 72.2974C44.0042 69.1863 46.4486 66.7419 49.5597 66.7419L49.5597 66.7419C52.6708 66.7419 55.1153 69.1863 55.1153 72.2974L55.1153 77.853Z" fill="#111111" fill-rule="nonzero" opacity="1" stroke="none"/>
376
+ <path d="M21.7819 33.4085L32.893 33.4085L32.893 33.4085L32.893 55.6308L32.893 55.6308L21.7819 55.6308L21.7819 55.6308L21.7819 33.4085L21.7819 33.4085Z" fill="#111111" fill-rule="nonzero" opacity="1" stroke="none"/>
377
+ <path d="M66.2264 33.4085L77.3375 33.4085L77.3375 33.4085L77.3375 55.6308L77.3375 55.6308L66.2264 55.6308L66.2264 55.6308L66.2264 33.4085L66.2264 33.4085Z" fill="#111111" fill-rule="nonzero" opacity="1" stroke="none"/>
378
+ </g>
379
+ </g>
380
+ </g>
381
+ </svg>
382
+ <h1 style="font-weight: 900; margin-bottom: 7px;margin-top:5px">
383
+ {title}
384
+ </h1>
385
+ </div>
386
+ <p style="margin-bottom: 10px; font-size: 94%; line-height: 23px;">
387
+ {desc}
388
+ There is the <a href="{tutorial_link}"> tutorial </a>
389
+ </p>
390
+ </div>
391
+ """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
  )
393
  with gr.Group():
394
  with gr.Box():
 
472
  btn.click(infer, inputs=[text, negative, width, height, sampler, steps, seed, guidance_scale],
473
  outputs=[gallery], postprocess=False)
474
 
475
+ block.queue(concurrency_count=5,
476
  max_size=100).launch(
477
  max_threads=150,
478
  # server_port=6006,