takuma104 commited on
Commit
07cf1be
1 Parent(s): 8411d80

add control_v11p_sd15_inpaint

Browse files
Files changed (28) hide show
  1. gen_compare_v11/README.md +16 -0
  2. gen_compare_v11/gen_diffusers_image_for_inpaint.py +96 -0
  3. gen_compare_v11/gen_markdown.py +29 -0
  4. gen_compare_v11/gen_reference_image_for_inpaint.py +104 -0
  5. gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_0.png +3 -0
  6. gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_1.png +3 -0
  7. gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_2.png +3 -0
  8. gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_3.png +3 -0
  9. gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_0.png +3 -0
  10. gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_1.png +3 -0
  11. gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_2.png +3 -0
  12. gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_3.png +3 -0
  13. gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_0.png +3 -0
  14. gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_1.png +3 -0
  15. gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_2.png +3 -0
  16. gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_3.png +3 -0
  17. gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_0.png +3 -0
  18. gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_1.png +3 -0
  19. gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_2.png +3 -0
  20. gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_3.png +3 -0
  21. gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_0.png +3 -0
  22. gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_1.png +3 -0
  23. gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_2.png +3 -0
  24. gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_3.png +3 -0
  25. gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_0.png +3 -0
  26. gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_1.png +3 -0
  27. gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_2.png +3 -0
  28. 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

  • SHA256: 766a81aa8ed81fdd17da860e85dcd5f8e27af7a277a258a42ebc03c3266bf66c
  • Pointer size: 131 Bytes
  • Size of remote file: 422 kB
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_1.png ADDED

Git LFS Details

  • SHA256: 67a77f2272ad9e3a7705be8b5518f4f3f254c2cc6519dfe13980cb002962eb83
  • Pointer size: 131 Bytes
  • Size of remote file: 379 kB
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_2.png ADDED

Git LFS Details

  • SHA256: 0629bb1c2d0cf38e1adc98230c005593e5099b389526d136d9452231d761ec7b
  • Pointer size: 131 Bytes
  • Size of remote file: 370 kB
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_0_3.png ADDED

Git LFS Details

  • SHA256: 598283f15ae1e96b2ed0734c0aad41e1e45ef5df24bc812c53ae25f0e05d7809
  • Pointer size: 131 Bytes
  • Size of remote file: 476 kB
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_0.png ADDED

Git LFS Details

  • SHA256: 7f484e89a6aca46d8144bd8885c986a50e29314e0058aca2385dab7b7474df29
  • Pointer size: 131 Bytes
  • Size of remote file: 516 kB
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_1.png ADDED

Git LFS Details

  • SHA256: c74c880f671f2f5d0829e9bf894a190ffa46f453ae6ed0b1ad76fb12481c3f17
  • Pointer size: 131 Bytes
  • Size of remote file: 508 kB
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_2.png ADDED

Git LFS Details

  • SHA256: 91ec95353292ae83db7084191a8c5b99a5a95788c34a242f8ee32409b0cee7c1
  • Pointer size: 131 Bytes
  • Size of remote file: 511 kB
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_1_3.png ADDED

Git LFS Details

  • SHA256: dbec5533f04ab8b9e37c0b509aa40632bcd9fcb4f61b8403cc68e6d5342210cd
  • Pointer size: 131 Bytes
  • Size of remote file: 533 kB
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_0.png ADDED

Git LFS Details

  • SHA256: 713b1848e7a46a4afb3ae0a8b9d19f389fc4f99569b097287e63e4fe6418c846
  • Pointer size: 131 Bytes
  • Size of remote file: 501 kB
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_1.png ADDED

Git LFS Details

  • SHA256: 5389a5d1a4c204ee584550fc3894ba79820a9d10da446349fcb48612d3441168
  • Pointer size: 131 Bytes
  • Size of remote file: 484 kB
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_2.png ADDED

Git LFS Details

  • SHA256: 9890334bc1ec96a7d4078d69c3efd1f3bf04063614422a4c4bdfe9a5c83400aa
  • Pointer size: 131 Bytes
  • Size of remote file: 469 kB
gen_compare_v11/output_images/diffusers/output_p_sd15_inpaint_2_3.png ADDED

Git LFS Details

  • SHA256: 92b1b41dcc8cd515e72983cb54d05a227b4daae5a77abe2211c24c6f7be88807
  • Pointer size: 131 Bytes
  • Size of remote file: 566 kB
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_0.png ADDED

Git LFS Details

  • SHA256: 4ed4a4a1ce2ec1c464e8252c389dd3c0b6cef5465747fc50a4e355d60e0357ae
  • Pointer size: 131 Bytes
  • Size of remote file: 422 kB
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_1.png ADDED

Git LFS Details

  • SHA256: db9b0468f1d29cba494a80392673350fac1b911c9ae3deea68d2e99523bb6b08
  • Pointer size: 131 Bytes
  • Size of remote file: 379 kB
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_2.png ADDED

Git LFS Details

  • SHA256: 74e51fc226267d7c11725337cc6e9daff69de0e3066f1dc6ea29fbd34fb2990a
  • Pointer size: 131 Bytes
  • Size of remote file: 370 kB
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_0_3.png ADDED

Git LFS Details

  • SHA256: 39fcefb1398572e1ecfd484b2e695cee0a1c5882b9f6ee6b334f7d52efaa7a5a
  • Pointer size: 131 Bytes
  • Size of remote file: 476 kB
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_0.png ADDED

Git LFS Details

  • SHA256: 7799a63d9443fa3943fc47033e97eab484faf301e6f42b00162b717fcef0afde
  • Pointer size: 131 Bytes
  • Size of remote file: 516 kB
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_1.png ADDED

Git LFS Details

  • SHA256: b052ff551822bf9e5e13c655249153dfe9a5de6d24bf832bae1202a36256cb63
  • Pointer size: 131 Bytes
  • Size of remote file: 509 kB
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_2.png ADDED

Git LFS Details

  • SHA256: 366eed225eb2eee36082b57a43b0d43323735f7bea9e120cddc987cf96b6d3d0
  • Pointer size: 131 Bytes
  • Size of remote file: 511 kB
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_1_3.png ADDED

Git LFS Details

  • SHA256: 8e7342d84b28be6fed9e28eb6c8d429ce31bb2ddf9c23d5fc037c1e7ec630d6a
  • Pointer size: 131 Bytes
  • Size of remote file: 533 kB
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_0.png ADDED

Git LFS Details

  • SHA256: 48e2c6889d5b7ede3d53563c522aaf41e7bd9c615293fb8d928833e7a6888fa8
  • Pointer size: 131 Bytes
  • Size of remote file: 501 kB
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_1.png ADDED

Git LFS Details

  • SHA256: b1d8b2d102f75b74400f8eedcabb912b580321cd34b17b2f27c6c34547ade798
  • Pointer size: 131 Bytes
  • Size of remote file: 484 kB
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_2.png ADDED

Git LFS Details

  • SHA256: 1efd43303f18bf15c2cd93ab9cdab34cf88d1c652f4b0365ae4893dfcc193630
  • Pointer size: 131 Bytes
  • Size of remote file: 469 kB
gen_compare_v11/output_images/ref/output_p_sd15_inpaint_2_3.png ADDED

Git LFS Details

  • SHA256: 158a542426e015bc8fc74a666bf00c36ff46b32ec3767639462eae435bcd3e21
  • Pointer size: 131 Bytes
  • Size of remote file: 566 kB