Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -52,8 +52,6 @@ def style_aligned_controlnet(ref_style_prompt, depth_map, ref_image, img_generat
|
|
52 |
depth_image = pipeline_calls.get_depth_map(image, feature_processor, depth_estimator)
|
53 |
else:
|
54 |
depth_image = load_image(ref_image).resize((1024, 1024))
|
55 |
-
#reference_prompt = ref_style_prompt #"a poster in minimalist origami style"
|
56 |
-
#target_prompts = img_generation_prompt #["mona lisa"] #, "gal gadot"]
|
57 |
controlnet_conditioning_scale = 0.8
|
58 |
num_images_per_prompt = 3 # adjust according to VRAM size
|
59 |
latents = torch.randn(1 + num_images_per_prompt, 4, 128, 128).to(pipeline.unet.dtype)
|
@@ -103,4 +101,19 @@ with gr.Blocks() as demo:
|
|
103 |
api_name="style_aligned_controlnet")
|
104 |
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
demo.launch()
|
|
|
52 |
depth_image = pipeline_calls.get_depth_map(image, feature_processor, depth_estimator)
|
53 |
else:
|
54 |
depth_image = load_image(ref_image).resize((1024, 1024))
|
|
|
|
|
55 |
controlnet_conditioning_scale = 0.8
|
56 |
num_images_per_prompt = 3 # adjust according to VRAM size
|
57 |
latents = torch.randn(1 + num_images_per_prompt, 4, 128, 128).to(pipeline.unet.dtype)
|
|
|
101 |
api_name="style_aligned_controlnet")
|
102 |
|
103 |
|
104 |
+
|
105 |
+
gr.Examples(
|
106 |
+
examples=[
|
107 |
+
['A poster in a papercut art style.', True, 'example_image/A.png', 'A village in a papercut art style.'],
|
108 |
+
['A poster in a papercut art style.', True, 'example_image/camel.jpg', 'A village in a papercut art style.'],
|
109 |
+
['A poster in a papercut art style.', False, 'example_image/train.jpg', 'A village in a papercut art style.'],
|
110 |
+
['A poster in a papercut art style.', False, 'example_image/sun.png', 'A village in a papercut art style.'],
|
111 |
+
['A poster in a papercut art style.', True, 'example_image/whale.png', 'A village in a papercut art style.'],
|
112 |
+
],
|
113 |
+
inputs=[ref_style_prompt, depth_map, ref_image, img_generation_prompt],
|
114 |
+
outputs=[gallery, ref_style_image],
|
115 |
+
fn=style_aligned_controlnet,
|
116 |
+
)
|
117 |
+
|
118 |
+
|
119 |
demo.launch()
|