|
56 | 56 | lineart_pipe = StyleContentStableDiffusionControlNetPipeline.from_pretrained(base_model_path, controlnet=lineart_content_fusion_encoder)
|
57 | 57 | lineart_styleshot = StyleShot(device, lineart_pipe, lineart_ip_ckpt, lineart_style_aware_encoder_path, lineart_transformer_block_path)
|
58 | 58 |
|
| 59 | + |
59 | 60 | 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):
|
60 | 61 | weight_dtype = torch.float32
|
61 | 62 |
|
@@ -140,7 +141,7 @@ def process(style_image, content_image, prompt, num_samples, image_resolution, c
|
140 | 141 | with gr.Column():
|
141 | 142 | style_image = gr.Image(sources=['upload'], type="numpy", label='Style Image')
|
142 | 143 | with gr.Column():
|
143 |
| - with gr.Box(): |
| 144 | + with gr.Blocks(): |
144 | 145 | with gr.Column():
|
145 | 146 | content_image = gr.Image(sources=['upload'], type="numpy", label='Content Image (optional)')
|
146 | 147 | btn1 = gr.Radio(
|
@@ -174,16 +175,18 @@ def process(style_image, content_image, prompt, num_samples, image_resolution, c
|
174 | 175 | value='longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality')
|
175 | 176 |
|
176 | 177 | 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(): |
179 | 181 | with gr.Row():
|
180 | 182 | with gr.Column(scale = 1):
|
181 | 183 | contour_gallery = gr.Gallery(label='Contour Output', show_label=True, elem_id="gallery", columns=[1], rows=[1], height='auto')
|
182 | 184 | with gr.Column(scale = 4):
|
183 | 185 | image_gallery = gr.Gallery(label='Result for Contour', show_label=True, elem_id="gallery", columns=[4], rows=[1], height='auto')
|
184 | 186 | 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(): |
187 | 190 | with gr.Row():
|
188 | 191 | with gr.Column(scale = 1):
|
189 | 192 | line_gallery = gr.Gallery(label='Lineart Output', show_label=True, elem_id="gallery", columns=[1], rows=[1], height='auto')
|
|
0 commit comments