Skip to content

Commit 17f6f01

Browse files
authored
Merge pull request #53 from intel/version_1_5
Version 1 5
2 parents 8777289 + 3bd962a commit 17f6f01

File tree

15 files changed

+1039
-41
lines changed

15 files changed

+1039
-41
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: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,55 @@
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'
12-
13-
print("=========Chose SD-1.5 models to download and convert=========")
14-
print("1 - Square (512x512 output image) ")
15-
print("2 - Landscape (640x360 output image, 16:9) ")
16-
print("3 - Portrait (360x640 output image, 9:16) ")
17-
print("4 - Portrait_512x768 (512x768 output image), will take time since model is large ")
18-
print("5 - Landscape_768x512 (768x512 output image), will take time since model is large ")
19-
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 ")
13+
chose_model_controlnet=r'openvino-ai-plugins-gimp\controlnet_model_conversion.py'
2314

15+
16+
17+
2418
while True:
19+
20+
print("=========Chose SD-1.5 models to download and convert=========")
21+
print("1 - Square (512x512 output image) ")
22+
print("2 - Landscape (640x360 output image, 16:9) ")
23+
print("3 - Portrait (360x640 output image, 9:16) ")
24+
print("4 - Portrait_512x768 (512x768 output image), will take time since model is large ")
25+
print("5 - Landscape_768x512 (768x512 output image), will take time since model is large ")
26+
print("6 - SD-1.5 Inapinting model (512x512 output image) ")
27+
print("7 - SD-1.5 Controlnet-Openpose model (512x512 output image) ")
28+
print("8 - ALL the above SD-1.5 models ")
29+
print("9 - Only Square, Landscape, Portrait")
30+
print("10 - Skip All SD-1.5 Model setup ")
2531
choice = input("Enter the Number for the model you want to download & convert: ")
2632

2733
# setup all the SD1.5 models
28-
if choice=="7":
34+
if choice=="8":
2935
for i in range(1,7):
3036

3137
subprocess.call([sd_python_path, chose_model, str(i)])
32-
38+
39+
subprocess.call([sd_python_path, chose_model_controlnet, "7"])
3340
break
3441
# setup only square, landscape and Portrait
35-
elif choice=="8":
42+
elif choice=="9":
3643
for i in range(1,4):
3744

3845
subprocess.call([sd_python_path, chose_model, str(i)])
3946
break
40-
elif choice=="9":
47+
elif choice=="10":
4148
print("Exiting SD-1.5 Model setup.........")
4249
break
4350
elif choice in ["1","2","3","4","5","6"]:
4451

4552
subprocess.call([sd_python_path, chose_model, choice])
53+
elif choice == "7":
54+
55+
subprocess.call([sd_python_path, chose_model_controlnet, choice])
4656

47-
break
57+
#break
4858

4959
else:
5060
print("Wrong option selected.")

0 commit comments

Comments
 (0)