jozee commited on
Commit
94cac87
·
verified ·
1 Parent(s): cf732c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -11
app.py CHANGED
@@ -1,17 +1,33 @@
1
- import spaces
2
  import gradio as gr
 
 
 
 
3
  from gradio_imageslider import ImageSlider
4
- # from PIL import Image
 
 
 
 
 
5
  import numpy as np
6
- import torch
7
 
8
  with gr.Blocks() as demo:
9
-
10
- with gr.Row():
11
- with gr.Column(scale=1):
12
- input_image = gr.Image(label="Input Image", type="numpy")
13
- process_btn = gr.Button(value="generate", variant = "primary")
14
- with gr.Column(scale=1):
15
- output_image = gr.Image(label="Generated Image", interactive=False)
 
 
 
 
 
 
 
 
 
16
 
17
- demo.launch(debug=True)
 
 
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)