-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrun_flexiedit.py
91 lines (82 loc) · 3.19 KB
/
run_flexiedit.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Example of running MasaCtrl, ProxMasaCtrl, FlexiEdit
from inference_flexiedit import main
if __name__ == "__main__":
### fatty-corgi ###
main(
model_path = "../../pretrain_SD_models/CompVis/stable-diffusion-v1-4", #NOTE: please change the path to the model
out_dir="./outputs/result_flexiedit/",
source_image_path="./images/fatty-corgi.jpg",
source_prompt="A corgi is sitting on the floor",
target_prompt="A corgi is standing on the floor",
num_inference_steps=50,
reinversion_steps=30,
blended_word=["corgi", "corgi"],
cuda_device="cuda:1",
bbx_start_point = (231, 382),
bbx_end_point = (456, 455)
)
### shepherd ###
main(
model_path = "../../pretrain_SD_models/CompVis/stable-diffusion-v1-4",
out_dir="./outputs/result_flexiedit/",
source_image_path="./images/shepherd.jpg",
source_prompt="A dog standing on the ground",
target_prompt="A dog jumping on the ground",
reinversion_steps=20,
blended_word=["dog", "dog"],
cuda_device="cuda:0",
start_point = (199, 356),
end_point = (484, 466)
)
### fatty-corgi ###
main(
model_path="../../pretrain_SD_models/stabilityai/stable-diffusion-2-1-base",
out_dir="./outputs/result_flexiedit/",
source_image_path="./images/fatty-corgi.jpg",
source_prompt="A corgi is sitting on the floor",
target_prompt="A corgi is standing on the floor",
reinversion_steps=30,
blended_word=["corgi", "corgi"],
cuda_device="cuda:0",
bbx_start_point = (231, 382),
bbx_end_point = (456, 455)
)
### teddybear ###
main(
model_path="../../pretrain_SD_models/stabilityai/stable-diffusion-2-1-base",
out_dir="./outputs/result_flexiedit/",
source_image_path="./images/teddybear.jpg",
source_prompt="A teddybear is sitting on the ground",
target_prompt="A teddybear is running on the ground",
reinversion_steps=30,
blended_word= ["teddybear", "teddybear"],
cuda_device="cuda:0",
bbx_start_point = (161, 257),
bbx_end_point = (355, 402)
)
### white_horse ###
main(
model_path="../../pretrain_SD_models/stabilityai/stable-diffusion-2-1-base",
out_dir="./outputs/result_flexiedit/",
source_image_path="./images/white_horse.jpg",
source_prompt="A white horse is standing",
target_prompt="A white horse is running",
reinversion_steps=30,
blended_word= ["horse", "horse"],
cuda_device="cuda:0",
bbx_start_point = (248, 279),
bbx_end_point = (385, 400)
)
### yellow_cat ###
main(
model_path="../../pretrain_SD_models/stabilityai/stable-diffusion-2-1-base",
out_dir="./outputs/result_flexiedit/",
source_image_path="./images/yellow_cat.jpg",
source_prompt="A cat",
target_prompt="A cat with side view",
reinversion_steps=40,
blended_word= ["cat", "cat"],
cuda_device="cuda:0",
bbx_start_point = (119, 6),
bbx_end_point = (261, 158)
)