Skip to content

Commit 565f1b2

Browse files
committed
update gradio
1 parent 689260e commit 565f1b2

File tree

2 files changed

+8
-205
lines changed

2 files changed

+8
-205
lines changed

styleshot_demo.py

Lines changed: 0 additions & 200 deletions
This file was deleted.

styleshot_gradio_demo.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
lineart_pipe = StyleContentStableDiffusionControlNetPipeline.from_pretrained(base_model_path, controlnet=lineart_content_fusion_encoder)
5757
lineart_styleshot = StyleShot(device, lineart_pipe, lineart_ip_ckpt, lineart_style_aware_encoder_path, lineart_transformer_block_path)
5858

59+
5960
def process(style_image, content_image, prompt, num_samples, image_resolution, condition_scale, style_scale,ddim_steps, guidance_scale, seed, a_prompt, n_prompt, btn1, Contour_Threshold=200):
6061
weight_dtype = torch.float32
6162

@@ -140,7 +141,7 @@ def process(style_image, content_image, prompt, num_samples, image_resolution, c
140141
with gr.Column():
141142
style_image = gr.Image(sources=['upload'], type="numpy", label='Style Image')
142143
with gr.Column():
143-
with gr.Box():
144+
with gr.Blocks():
144145
with gr.Column():
145146
content_image = gr.Image(sources=['upload'], type="numpy", label='Content Image (optional)')
146147
btn1 = gr.Radio(
@@ -174,16 +175,18 @@ def process(style_image, content_image, prompt, num_samples, image_resolution, c
174175
value='longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality')
175176

176177
with gr.Row():
177-
with gr.Box():
178-
gr.Markdown("### Results for Contour")
178+
gr.Markdown("### Results for Contour")
179+
with gr.Row():
180+
with gr.Blocks():
179181
with gr.Row():
180182
with gr.Column(scale = 1):
181183
contour_gallery = gr.Gallery(label='Contour Output', show_label=True, elem_id="gallery", columns=[1], rows=[1], height='auto')
182184
with gr.Column(scale = 4):
183185
image_gallery = gr.Gallery(label='Result for Contour', show_label=True, elem_id="gallery", columns=[4], rows=[1], height='auto')
184186
with gr.Row():
185-
with gr.Box():
186-
gr.Markdown("### Results for Lineart")
187+
gr.Markdown("### Results for Lineart")
188+
with gr.Row():
189+
with gr.Blocks():
187190
with gr.Row():
188191
with gr.Column(scale = 1):
189192
line_gallery = gr.Gallery(label='Lineart Output', show_label=True, elem_id="gallery", columns=[1], rows=[1], height='auto')

0 commit comments

Comments
 (0)