Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,33 @@
|
|
1 |
-
import spaces
|
2 |
import gradio as gr
|
|
|
|
|
|
|
|
|
3 |
from gradio_imageslider import ImageSlider
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
5 |
import numpy as np
|
6 |
-
import torch
|
7 |
|
8 |
with gr.Blocks() as demo:
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
-
demo.launch(
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
import spaces
|
3 |
+
import torch
|
4 |
+
from diffusers import AutoencoderKL, TCDScheduler
|
5 |
+
from diffusers.models.model_loading_utils import load_state_dict
|
6 |
from gradio_imageslider import ImageSlider
|
7 |
+
from huggingface_hub import hf_hub_download
|
8 |
+
|
9 |
+
from controlnet_union import ControlNetModel_Union
|
10 |
+
from pipeline_fill_sd_xl import StableDiffusionXLFillPipeline
|
11 |
+
|
12 |
+
from PIL import Image, ImageDraw
|
13 |
import numpy as np
|
|
|
14 |
|
15 |
with gr.Blocks() as demo:
|
16 |
+
with gr.Column():
|
17 |
+
with gr.Row():
|
18 |
+
with gr.Column():
|
19 |
+
input_image = gr.Image(
|
20 |
+
type="pil",
|
21 |
+
label="Input Image"
|
22 |
+
)
|
23 |
+
|
24 |
+
with gr.Row():
|
25 |
+
with gr.Column(scale=2):
|
26 |
+
prompt_input = gr.Textbox(label="Prompt (Optional)")
|
27 |
+
with gr.Column(scale=1):
|
28 |
+
run_button = gr.Button('Generate')
|
29 |
+
|
30 |
+
with gr.Column():
|
31 |
+
result = gr.Image(label="Generate Image", interactive=False)
|
32 |
|
33 |
+
demo.queue(max_size=12).launch(share=False)
|