add control_v11p_sd15_inpaint
Browse files- gen_compare_v11/README.md +16 -0
- gen_compare_v11/gen_diffusers_image_for_inpaint.py +96 -0
- gen_compare_v11/gen_markdown.py +29 -0
- gen_compare_v11/gen_reference_image_for_inpaint.py +104 -0
- gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_0.png +3 -0
- gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_1.png +3 -0
- gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_2.png +3 -0
- gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_3.png +3 -0
- gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_0.png +3 -0
- gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_1.png +3 -0
- gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_2.png +3 -0
- gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_3.png +3 -0
- gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_0.png +3 -0
- gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_1.png +3 -0
- gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_2.png +3 -0
- gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_3.png +3 -0
- gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_0.png +3 -0
- gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_1.png +3 -0
- gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_2.png +3 -0
- gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_3.png +3 -0
- gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_0.png +3 -0
- gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_1.png +3 -0
- gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_2.png +3 -0
- gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_3.png +3 -0
- gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_0.png +3 -0
- gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_1.png +3 -0
- gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_2.png +3 -0
- gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_3.png +3 -0
gen_compare_v11/README.md
CHANGED
@@ -100,3 +100,19 @@
|
|
100 |
|1|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/converted/lineartanime_anime2_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/converted/lineartanime_anime2_512x512.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15s2_lineart_anime_0_1.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15s2_lineart_anime_0_1.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15s2_lineart_anime_0_1.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15s2_lineart_anime_0_1.png"/></a>|
|
101 |
|2|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/converted/lineartanime_anime2_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/converted/lineartanime_anime2_512x512.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15s2_lineart_anime_0_2.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15s2_lineart_anime_0_2.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15s2_lineart_anime_0_2.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15s2_lineart_anime_0_2.png"/></a>|
|
102 |
|3|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/converted/lineartanime_anime2_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/converted/lineartanime_anime2_512x512.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15s2_lineart_anime_0_3.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15s2_lineart_anime_0_3.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15s2_lineart_anime_0_3.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15s2_lineart_anime_0_3.png"/></a>|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
|1|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/converted/lineartanime_anime2_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/converted/lineartanime_anime2_512x512.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15s2_lineart_anime_0_1.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15s2_lineart_anime_0_1.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15s2_lineart_anime_0_1.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15s2_lineart_anime_0_1.png"/></a>|
|
101 |
|2|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/converted/lineartanime_anime2_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/converted/lineartanime_anime2_512x512.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15s2_lineart_anime_0_2.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15s2_lineart_anime_0_2.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15s2_lineart_anime_0_2.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15s2_lineart_anime_0_2.png"/></a>|
|
102 |
|3|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/converted/lineartanime_anime2_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/converted/lineartanime_anime2_512x512.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15s2_lineart_anime_0_3.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15s2_lineart_anime_0_3.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15s2_lineart_anime_0_3.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15s2_lineart_anime_0_3.png"/></a>|
|
103 |
+
## control_v11p_sd15_inpaint
|
104 |
+
|
105 |
+
|seed|conditional image|ref|diffusers|
|
106 |
+
|:---:|:---:|:---:|:---:|
|
107 |
+
|0|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/pexels-sound-on-3760767_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/pexels-sound-on-3760767_512x512.png"/></a><a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_0.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_0.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_0.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_0.png"/></a>|
|
108 |
+
|1|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/pexels-sound-on-3760767_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/pexels-sound-on-3760767_512x512.png"/></a><a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_1.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_1.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_1.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_1.png"/></a>|
|
109 |
+
|2|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/pexels-sound-on-3760767_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/pexels-sound-on-3760767_512x512.png"/></a><a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_2.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_2.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_2.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_2.png"/></a>|
|
110 |
+
|3|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/pexels-sound-on-3760767_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/pexels-sound-on-3760767_512x512.png"/></a><a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_3.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_3.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_3.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_3.png"/></a>|
|
111 |
+
|0|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/vermeer_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/vermeer_512x512.png"/></a><a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_0.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_0.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_0.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_0.png"/></a>|
|
112 |
+
|1|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/vermeer_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/vermeer_512x512.png"/></a><a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_1.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_1.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_1.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_1.png"/></a>|
|
113 |
+
|2|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/vermeer_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/vermeer_512x512.png"/></a><a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_2.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_2.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_2.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_2.png"/></a>|
|
114 |
+
|3|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/vermeer_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/vermeer_512x512.png"/></a><a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_3.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_3.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_3.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_3.png"/></a>|
|
115 |
+
|0|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/bird_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/bird_512x512.png"/></a><a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_0.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_0.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_0.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_0.png"/></a>|
|
116 |
+
|1|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/bird_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/bird_512x512.png"/></a><a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_1.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_1.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_1.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_1.png"/></a>|
|
117 |
+
|2|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/bird_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/bird_512x512.png"/></a><a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_2.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_2.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_2.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_2.png"/></a>|
|
118 |
+
|3|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/bird_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/bird_512x512.png"/></a><a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/control_images/mask_512x512.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_3.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_3.png"/></a>|<a href="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_3.png"><img width="128" src="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_3.png"/></a>|
|
gen_compare_v11/gen_diffusers_image_for_inpaint.py
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Diffusers' ControlNet Implementation Subjective Evaluation
|
2 |
+
|
3 |
+
import einops
|
4 |
+
import numpy as np
|
5 |
+
import torch
|
6 |
+
import sys
|
7 |
+
import os
|
8 |
+
import yaml
|
9 |
+
|
10 |
+
from diffusers import StableDiffusionControlNetPipeline, ControlNetModel, DDIMScheduler
|
11 |
+
|
12 |
+
from PIL import Image
|
13 |
+
|
14 |
+
test_prompt = "best quality, extremely detailed"
|
15 |
+
test_negative_prompt = "lowres, bad anatomy, worst quality, low quality"
|
16 |
+
|
17 |
+
|
18 |
+
def make_image_condition(image, image_mask=None):
|
19 |
+
image = np.array(image.convert("RGB")).astype(np.float32) / 255.0
|
20 |
+
if image_mask is not None:
|
21 |
+
image_mask = np.array(image_mask.convert("L"))
|
22 |
+
assert (
|
23 |
+
image.shape[0:1] == image_mask.shape[0:1]
|
24 |
+
), "image and image_mask must have the same image size"
|
25 |
+
image[image_mask < 128] = -1.0 # set as masked pixel
|
26 |
+
image = np.expand_dims(image, 0).transpose(0, 3, 1, 2)
|
27 |
+
image = torch.from_numpy(image)
|
28 |
+
return image
|
29 |
+
|
30 |
+
|
31 |
+
def generate_image(seed, prompt, negative_prompt, control, guess_mode=False):
|
32 |
+
latent = torch.randn(
|
33 |
+
(1, 4, 64, 64),
|
34 |
+
device="cpu",
|
35 |
+
generator=torch.Generator(device="cpu").manual_seed(seed),
|
36 |
+
).cuda()
|
37 |
+
image = pipe(
|
38 |
+
prompt=prompt,
|
39 |
+
negative_prompt=negative_prompt,
|
40 |
+
guidance_scale=4.0 if guess_mode else 9.0,
|
41 |
+
num_inference_steps=50 if guess_mode else 20,
|
42 |
+
latents=latent,
|
43 |
+
image=control,
|
44 |
+
# guess_mode=guess_mode,
|
45 |
+
).images[0]
|
46 |
+
return image
|
47 |
+
|
48 |
+
|
49 |
+
if __name__ == "__main__":
|
50 |
+
model_name = "p_sd15_inpaint"
|
51 |
+
original_image_folder = "./control_images/"
|
52 |
+
control_image_folder = "./control_images/converted/"
|
53 |
+
output_image_folder = "./output_images/diffusers/"
|
54 |
+
os.makedirs(output_image_folder, exist_ok=True)
|
55 |
+
|
56 |
+
model_id = f"lllyasviel/control_v11{model_name}"
|
57 |
+
|
58 |
+
controlnet = ControlNetModel.from_pretrained(model_id)
|
59 |
+
if model_name == "p_sd15s2_lineart_anime":
|
60 |
+
base_model_id = "Linaqruf/anything-v3.0"
|
61 |
+
base_model_revision = None
|
62 |
+
else:
|
63 |
+
base_model_id = "runwayml/stable-diffusion-v1-5"
|
64 |
+
base_model_revision = "non-ema"
|
65 |
+
|
66 |
+
pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
67 |
+
base_model_id,
|
68 |
+
revision=base_model_revision,
|
69 |
+
controlnet=controlnet,
|
70 |
+
safety_checker=None,
|
71 |
+
).to("cuda")
|
72 |
+
pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
|
73 |
+
|
74 |
+
original_image_filenames = [
|
75 |
+
"pexels-sound-on-3760767_512x512.png",
|
76 |
+
"vermeer_512x512.png",
|
77 |
+
"bird_512x512.png",
|
78 |
+
]
|
79 |
+
|
80 |
+
inpaint_image_conditions = [
|
81 |
+
make_image_condition(
|
82 |
+
Image.open(f"{original_image_folder}{fn}"),
|
83 |
+
Image.open(f"{original_image_folder}mask_512x512.png"),
|
84 |
+
)
|
85 |
+
for fn in original_image_filenames
|
86 |
+
]
|
87 |
+
|
88 |
+
for i, control in enumerate(inpaint_image_conditions):
|
89 |
+
for seed in range(4):
|
90 |
+
image = generate_image(
|
91 |
+
seed=seed,
|
92 |
+
prompt=test_prompt,
|
93 |
+
negative_prompt=test_negative_prompt,
|
94 |
+
control=control,
|
95 |
+
)
|
96 |
+
image.save(f"{output_image_folder}output_{model_name}_{i}_{seed}.png")
|
gen_compare_v11/gen_markdown.py
CHANGED
@@ -64,3 +64,32 @@ for cnet in cnet_models:
|
|
64 |
print(f'<a href="{url}"><img width="128" src="{url}"/></a>|', end="")
|
65 |
|
66 |
print("")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
print(f'<a href="{url}"><img width="128" src="{url}"/></a>|', end="")
|
65 |
|
66 |
print("")
|
67 |
+
|
68 |
+
|
69 |
+
original_image_folder = "control_images"
|
70 |
+
original_image_filenames = [
|
71 |
+
"pexels-sound-on-3760767_512x512.png",
|
72 |
+
"vermeer_512x512.png",
|
73 |
+
"bird_512x512.png",
|
74 |
+
]
|
75 |
+
|
76 |
+
cnet = "p_sd15_inpaint"
|
77 |
+
print(f"## control_v11{cnet}")
|
78 |
+
print("")
|
79 |
+
print_header()
|
80 |
+
|
81 |
+
for i, original_image_fn in enumerate(original_image_filenames):
|
82 |
+
for seed in range(4):
|
83 |
+
print(f"|{seed}|", end="")
|
84 |
+
|
85 |
+
url = get_url(path=f"{original_image_folder}/{original_image_fn}")
|
86 |
+
print(f'<a href="{url}"><img width="128" src="{url}"/></a>', end="")
|
87 |
+
url = get_url(path=f"{original_image_folder}/mask_512x512.png")
|
88 |
+
print(f'<a href="{url}"><img width="128" src="{url}"/></a>|', end="")
|
89 |
+
|
90 |
+
for proc in processors:
|
91 |
+
url = get_url(path=f"output_images/{proc}/output_{cnet}_{i}_{seed:01d}.png")
|
92 |
+
print(f'<a href="{url}"><img width="128" src="{url}"/></a>|', end="")
|
93 |
+
|
94 |
+
print("")
|
95 |
+
|
gen_compare_v11/gen_reference_image_for_inpaint.py
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# from https://github.com/lllyasviel/ControlNet/blob/main/gradio_canny2image.py
|
2 |
+
|
3 |
+
import einops
|
4 |
+
import numpy as np
|
5 |
+
import torch
|
6 |
+
from PIL import Image
|
7 |
+
import sys
|
8 |
+
import os
|
9 |
+
import yaml
|
10 |
+
|
11 |
+
CONTROL_NET_PATH = '/home/takuma/Documents/co/ControlNet-v1-1-nightly/'
|
12 |
+
CONTROL_NET_MODEL_PATH = '../../ControlNet-v1-1'
|
13 |
+
sys.path.append(CONTROL_NET_PATH)
|
14 |
+
|
15 |
+
from share import *
|
16 |
+
from pytorch_lightning import seed_everything
|
17 |
+
from cldm.model import create_model, load_state_dict
|
18 |
+
from cldm.ddim_hacked import DDIMSampler
|
19 |
+
from diffusers.utils import load_image
|
20 |
+
|
21 |
+
test_prompt = "best quality, extremely detailed"
|
22 |
+
test_negative_prompt = "lowres, bad anatomy, worst quality, low quality"
|
23 |
+
|
24 |
+
@torch.no_grad()
|
25 |
+
def generate(prompt, n_prompt, seed, control, ddim_steps=20, eta=0.0, scale=9.0, H=512, W=512, strength = 1.0, guess_mode=False):
|
26 |
+
seed_everything(seed)
|
27 |
+
|
28 |
+
cond = {"c_concat": [control], "c_crossattn": [model.get_learned_conditioning([prompt] * num_samples)]}
|
29 |
+
un_cond = {"c_concat": None if guess_mode else [control], "c_crossattn": [model.get_learned_conditioning([n_prompt] * num_samples)]}
|
30 |
+
shape = (4, H // 8, W // 8)
|
31 |
+
|
32 |
+
model.control_scales = [strength * (0.825 ** float(12 - i)) for i in range(13)] if guess_mode else ([strength] * 13) # Magic number. IDK why. Perhaps because 0.825**12<0.01 but 0.826**12>0.01
|
33 |
+
latent = torch.randn((1,) + shape, device="cpu", generator=torch.Generator(device="cpu").manual_seed(seed)).cuda()
|
34 |
+
samples, intermediates = ddim_sampler.sample(ddim_steps, num_samples,
|
35 |
+
shape, cond, x_T=latent,
|
36 |
+
verbose=False, eta=eta,
|
37 |
+
unconditional_guidance_scale=scale,
|
38 |
+
unconditional_conditioning=un_cond)
|
39 |
+
x_samples = model.decode_first_stage(samples)
|
40 |
+
x_samples = (einops.rearrange(x_samples, 'b c h w -> b h w c') * 127.5 + 127.5).cpu().numpy().clip(0, 255).astype(np.uint8)
|
41 |
+
|
42 |
+
return Image.fromarray(x_samples[0])
|
43 |
+
|
44 |
+
def control_images(control_image_folder, model_name):
|
45 |
+
with open('./control_images.yaml', 'r') as f:
|
46 |
+
d = yaml.safe_load(f)
|
47 |
+
filenames = d[model_name]
|
48 |
+
return [Image.open(f'{control_image_folder}/{fn}').convert("RGB") for fn in filenames]
|
49 |
+
|
50 |
+
def make_image_condition(image, image_mask=None):
|
51 |
+
image = np.array(image.convert("RGB")).astype(np.float32) / 255.0
|
52 |
+
if image_mask is not None:
|
53 |
+
image_mask = np.array(image_mask.convert("L"))
|
54 |
+
assert (
|
55 |
+
image.shape[0:1] == image_mask.shape[0:1]
|
56 |
+
), "image and image_mask must have the same image size"
|
57 |
+
image[image_mask < 128] = -1.0 # set as masked pixel
|
58 |
+
image = np.expand_dims(image, 0).transpose(0, 3, 1, 2)
|
59 |
+
image = torch.from_numpy(image)
|
60 |
+
return image
|
61 |
+
|
62 |
+
if __name__ == '__main__':
|
63 |
+
model_name = "p_sd15_inpaint"
|
64 |
+
|
65 |
+
original_image_folder = "./control_images/"
|
66 |
+
control_image_folder = './control_images/converted/'
|
67 |
+
output_image_folder = './output_images/ref/'
|
68 |
+
os.makedirs(output_image_folder, exist_ok=True)
|
69 |
+
|
70 |
+
if model_name == 'p_sd15s2_lineart_anime':
|
71 |
+
base_model_file = 'anything-v3-full.safetensors'
|
72 |
+
else:
|
73 |
+
base_model_file = 'v1-5-pruned.ckpt'
|
74 |
+
|
75 |
+
num_samples = 1
|
76 |
+
model = create_model(f'{CONTROL_NET_MODEL_PATH}/control_v11{model_name}.yaml').cpu()
|
77 |
+
model.load_state_dict(load_state_dict(f'{CONTROL_NET_PATH}/models/{base_model_file}', location='cuda'), strict=False)
|
78 |
+
model.load_state_dict(load_state_dict(f'{CONTROL_NET_MODEL_PATH}/control_v11{model_name}.pth', location='cuda'), strict=False)
|
79 |
+
model = model.cuda()
|
80 |
+
ddim_sampler = DDIMSampler(model)
|
81 |
+
|
82 |
+
original_image_filenames = [
|
83 |
+
"pexels-sound-on-3760767_512x512.png",
|
84 |
+
"vermeer_512x512.png",
|
85 |
+
"bird_512x512.png",
|
86 |
+
]
|
87 |
+
|
88 |
+
inpaint_image_conditions = [
|
89 |
+
make_image_condition(
|
90 |
+
Image.open(f"{original_image_folder}{fn}"),
|
91 |
+
Image.open(f"{original_image_folder}mask_512x512.png"),
|
92 |
+
)
|
93 |
+
for fn in original_image_filenames
|
94 |
+
]
|
95 |
+
|
96 |
+
for i, control in enumerate(inpaint_image_conditions):
|
97 |
+
# control = np.array(control)[:,:,::-1].copy()
|
98 |
+
# control = torch.from_numpy(control).float().cuda() / 255.0
|
99 |
+
# control = torch.stack([control for _ in range(num_samples)], dim=0)
|
100 |
+
# control = einops.rearrange(control, 'b h w c -> b c h w').clone()
|
101 |
+
control = control.cuda()
|
102 |
+
for seed in range(4):
|
103 |
+
image = generate(test_prompt, test_negative_prompt, seed=seed, control=control)
|
104 |
+
image.save(f'{output_image_folder}output_{model_name}_{i}_{seed}.png')
|
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_0.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_1.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_2.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_3.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_0.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_1.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_2.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_3.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_0.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_1.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_2.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_3.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_0.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_1.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_2.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_3.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_0.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_1.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_2.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_3.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_0.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_1.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_2.png
ADDED
Git LFS Details
|
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_3.png
ADDED
Git LFS Details
|