File size: 1,589 Bytes
2204ef0
 
50bd6a9
cab0202
 
f5da000
 
 
1e1a292
 
 
50bd6a9
f5da000
 
49ae800
 
 
b8a138a
49ae800
 
 
 
 
 
 
 
 
 
 
f5da000
 
cab0202
f5da000
cab0202
f5da000
cab0202
f5da000
cab0202
 
 
 
29c6952
02b0530
f5da000
8bf6bdc
f5da000
 
50bd6a9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import gradio as gr

from diffusion_webui import (
    StableDiffusionControlNetGenerator,
    StableDiffusionControlNetInpaintGenerator,
    StableDiffusionImage2ImageGenerator,
    StableDiffusionInpaintGenerator,
    StableDiffusionText2ImageGenerator,
)


def diffusion_app():
    app = gr.Blocks()
    with app:
        gr.HTML(
        """
        <h1 style='text-align: center'>
       Stable Diffusion + ControlNet + Inpaint
        </h1>
        """
    )
        gr.HTML(
            """
            <h3 style='text-align: center'>
            Follow me for more! 
            <a href='https://twitter.com/kadirnar_ai' target='_blank'>Twitter</a> | <a href='https://github.com/kadirnar' target='_blank'>Github</a> | <a href='https://www.linkedin.com/in/kadir-nar/' target='_blank'>Linkedin</a>
            </h3>
            """
    )
        with gr.Row():
            with gr.Column():
                with gr.Tab(label="Text2Image"):
                    StableDiffusionText2ImageGenerator.app()
                with gr.Tab(label="Image2Image"):
                    StableDiffusionImage2ImageGenerator.app()
                with gr.Tab(label="Inpaint"):
                    StableDiffusionInpaintGenerator.app()
                with gr.Tab(label="Controlnet"):
                    StableDiffusionControlNetGenerator.app()
                with gr.Tab(label="Controlnet Inpaint"):
                    StableDiffusionControlNetInpaintGenerator.app()

    app.queue(concurrency_count=2)
    app.launch(debug=True, enable_queue=True)


if __name__ == "__main__":
    diffusion_app()