Skip to content

Commit 11bb228

Browse files
committed
Added controlnet-pose support
1 parent d145834 commit 11bb228

File tree

11 files changed

+1027
-24
lines changed

11 files changed

+1027
-24
lines changed

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This branch is currently under development. <br>Dedicated for GIMP 3, Python 3 a
99
[2] Style-Transfer <br>
1010
[3] Inpainting <br>
1111
[4] Semantic-Segmentation <br>
12-
[5] Stable-Diffusion (Suppports - SD 1.4, SD 1.5 (landscape & portrait), SD 1.5 Inpainting) <br>
12+
[5] Stable-Diffusion (Suppports - SD 1.4, SD 1.5 (landscape & portrait), SD 1.5 Inpainting, SD 1.5 Controlnet-Openpose) <br>
1313

1414
# Objectives
1515
[1] Provides a set of OpenVino based plugins that add AI features to GIMP. <br>
@@ -86,10 +86,22 @@ Skip steps 1 and 2 if you already have Python3 and Git on Windows
8686
#### C. Stable-Diffusion-1.5 Inpainting - Make sure to download and convert the model during install process.
8787
1. Choose a layer or Open an image of size 512x512. (Currently works best with this resolution) <br>
8888
2. Use "Free select tool" to select the area in your image that you wish to change. <br>
89-
3. Right click on you image and click on "Add layer mask". Then choose "Selection" in "Initalize layer Mask to". This should create a mask with your selection.
89+
3. Right click on your image and click on "Add layer mask". Then choose "Selection" in "Initalize layer Mask to". This should create a mask with your selection.
9090
4. Follow steps 2,3,4,5 from section A. Please note that you will only see "SD_1.5_Inpainting" in model options if you added a mask layer to your image. <br>
9191
5. Click on “Run Inference”. Wait for the total inference steps to get completed. <br>
9292

93+
94+
#### D. Stable-Diffusion-1.5 Controlnet-Openpose - Make sure to download and convert the model during install process.
95+
1. Open an image with some pose that you want to see in new image. <br>
96+
2. Select Stable Diffusion from the drop down list in layers -> OpenVINO-AI-Plugins <br>
97+
3. Choose the controlnet_openpose model and device from the drop down list.<br>
98+
4. Make sure to select -- "Use Initial Image" option from the GUI. If not selected then it will fail.
99+
5. Follow steps 4,5 from section A. <br>
100+
5. Click on “Run Inference”. Wait for the total inference steps to get completed. <br>
101+
102+
![](gifs/controlnet-openpose.png)
103+
104+
93105
*If create gif option is selected, please note that performance will reduce. The generated gif is located in below path. You can play it in GIMP by going to Filters -> Animations -> Playback* <br>
94106
```C:\Users\<user_name>\openvino-ai-plugins-gimp\gif\stable_diffusion.gif``` <br>
95107

choose_sd_model.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66
if platform.system() == "Linux":
77
sd_python_path=os.path.join(".", "model_conv/bin/python3")
88
chose_model=os.path.join(os.path.dirname(__file__), "sd_model_conversion.py")
9+
chose_model_controlnet=os.path.join(os.path.dirname(__file__), "controlnet_model_conversion.py")
910
else:
1011
sd_python_path=r'model_conv\Scripts\python.exe'
1112
chose_model=r'openvino-ai-plugins-gimp\sd_model_conversion.py'
13+
chose_model_controlnet=r'openvino-ai-plugins-gimp\controlnet_model_conversion.py'
14+
15+
1216

1317
print("=========Chose SD-1.5 models to download and convert=========")
1418
print("1 - Square (512x512 output image) ")
@@ -17,32 +21,37 @@
1721
print("4 - Portrait_512x768 (512x768 output image), will take time since model is large ")
1822
print("5 - Landscape_768x512 (768x512 output image), will take time since model is large ")
1923
print("6 - SD-1.5 Inapinting model (512x512 output image) ")
20-
print("7 - ALL the above SD-1.5 models ")
21-
print("8 - Only Square, Landscape, Portrait")
22-
print("9 - Skip All SD-1.5 Model setup ")
24+
print("7 - SD-1.5 Controlnet-Openpose model (512x512 output image) ")
25+
print("8 - ALL the above SD-1.5 models ")
26+
print("9 - Only Square, Landscape, Portrait")
27+
print("10 - Skip All SD-1.5 Model setup ")
2328

2429
while True:
2530
choice = input("Enter the Number for the model you want to download & convert: ")
2631

2732
# setup all the SD1.5 models
28-
if choice=="7":
33+
if choice=="8":
2934
for i in range(1,7):
3035

3136
subprocess.call([sd_python_path, chose_model, str(i)])
32-
37+
38+
subprocess.call([sd_python_path, chose_model_controlnet, "7"])
3339
break
3440
# setup only square, landscape and Portrait
35-
elif choice=="8":
41+
elif choice=="9":
3642
for i in range(1,4):
3743

3844
subprocess.call([sd_python_path, chose_model, str(i)])
3945
break
40-
elif choice=="9":
46+
elif choice=="10":
4147
print("Exiting SD-1.5 Model setup.........")
4248
break
4349
elif choice in ["1","2","3","4","5","6"]:
4450

4551
subprocess.call([sd_python_path, chose_model, choice])
52+
elif choice == "7":
53+
54+
subprocess.call([sd_python_path, chose_model_controlnet, choice])
4655

4756
break
4857

0 commit comments

Comments
 (0)