forked from Yuanshi9815/OminiControl
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdebug_predict.py
More file actions
81 lines (59 loc) · 2.16 KB
/
debug_predict.py
File metadata and controls
81 lines (59 loc) · 2.16 KB
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
from predict import SchnellPredictor, DevPredictor
def schnell(prompt, task, control_image, num_outputs=1, seed=42):
predictor = SchnellPredictor()
predictor.setup()
predictor.predict(
prompt=prompt,
task=task,
control_image=control_image,
num_outputs=num_outputs,
num_inference_steps=8,
guidance_scale=3.5,
seed=seed,
output_format="webp",
output_quality=100,
)
def dev(prompt, task, control_image, num_outputs=1, seed=42):
predictor = DevPredictor()
predictor.setup()
predictor.predict(
prompt=prompt,
task=task,
control_image=control_image,
num_outputs=num_outputs,
num_inference_steps=28,
guidance_scale=3.5,
seed=seed,
output_format="webp",
output_quality=100,
)
def subject_512():
prompt = "On Christmas evening, on a crowded sidewalk, this item sits on the road, covered in snow and wearing a Christmas hat, holding a sign that reads 'Omini Control!'"
control_image = "assets/penguin.jpg"
task = "subject_512"
schnell(prompt, task, control_image)
def subject_1024():
prompt = "On the beach, a lady sits under a beach umbrella. She's wearing this shirt and has a big smile on her face, with her surfboard hehind her. The sun is setting in the background. The sky is a beautiful shade of orange and purple."
control_image = "assets/tshirt.jpg"
task = "subject_1024"
schnell(prompt, task, control_image, seed=0, num_outputs=4)
def fill():
prompt = (
"A yellow book with the word 'OMINI' in large font on the cover. The text 'for FLUX' appears at the bottom."
)
control_image = "assets/book_masked.jpg"
dev(prompt, "fill", control_image)
def spatial(task):
prompt = "In a bright room. A cup of a coffee with some beans on the side. They are placed on a dark wooden table."
control_image = "assets/coffee.png"
dev(prompt, task, control_image)
def canny():
spatial("canny")
def depth():
spatial("depth")
def coloring():
spatial("coloring")
def deblurring():
spatial("deblurring")
if __name__ == "__main__":
subject_1024()