Spaces:
Runtime error
Runtime error
Update app_base.py
Browse files- app_base.py +34 -24
app_base.py
CHANGED
@@ -51,6 +51,7 @@ def create_demo(model: Model) -> gr.Blocks:
|
|
51 |
def process_example(
|
52 |
image_url: str,
|
53 |
prompt: str,
|
|
|
54 |
adapter_name: str,
|
55 |
style_name: str,
|
56 |
guidance_scale: float,
|
@@ -62,7 +63,7 @@ def create_demo(model: Model) -> gr.Blocks:
|
|
62 |
return run(
|
63 |
image=image,
|
64 |
prompt=prompt,
|
65 |
-
negative_prompt=
|
66 |
adapter_name=adapter_name,
|
67 |
style_name=style_name,
|
68 |
guidance_scale=guidance_scale,
|
@@ -75,81 +76,89 @@ def create_demo(model: Model) -> gr.Blocks:
|
|
75 |
[
|
76 |
"assets/org_canny.jpg",
|
77 |
"Mystical fairy in real, magic, 4k picture, high quality",
|
|
|
78 |
"canny",
|
79 |
-
"
|
80 |
-
5
|
81 |
-
|
82 |
-
|
83 |
True,
|
84 |
],
|
85 |
[
|
86 |
"assets/org_sketch.png",
|
87 |
"a robot, mount fuji in the background, 4k photo, highly detailed",
|
|
|
88 |
"sketch",
|
89 |
-
"
|
90 |
-
5
|
91 |
1.0,
|
92 |
-
|
93 |
True,
|
94 |
],
|
95 |
[
|
96 |
"assets/org_lin.jpg",
|
97 |
"Ice dragon roar, 4k photo",
|
|
|
98 |
"lineart",
|
99 |
-
"
|
100 |
7.5,
|
101 |
0.8,
|
102 |
-
|
103 |
True,
|
104 |
],
|
105 |
[
|
106 |
"assets/org_mid.jpg",
|
107 |
"A photo of a room, 4k photo, highly detailed",
|
|
|
108 |
"depth-midas",
|
109 |
-
"
|
110 |
-
5
|
111 |
1.0,
|
112 |
-
|
113 |
True,
|
114 |
],
|
115 |
[
|
116 |
"assets/org_zoe.jpg",
|
117 |
"A photo of a orchid, 4k photo, highly detailed",
|
|
|
118 |
"depth-zoe",
|
119 |
-
"
|
120 |
5.0,
|
121 |
1.0,
|
122 |
-
|
123 |
True,
|
124 |
],
|
125 |
[
|
126 |
"assets/people.jpg",
|
127 |
"A couple, 4k photo, highly detailed",
|
|
|
128 |
"openpose",
|
129 |
-
"
|
130 |
5.0,
|
131 |
1.0,
|
132 |
-
|
133 |
True,
|
134 |
],
|
135 |
[
|
136 |
"assets/depth-midas-image.png",
|
137 |
"stormtrooper lecture, 4k photo, highly detailed",
|
|
|
138 |
"depth-midas",
|
139 |
-
"
|
140 |
-
5
|
141 |
1.0,
|
142 |
-
|
143 |
False,
|
144 |
],
|
145 |
[
|
146 |
"assets/openpose-image.png",
|
147 |
"spiderman, 4k photo, highly detailed",
|
|
|
148 |
"openpose",
|
149 |
-
"
|
150 |
5.0,
|
151 |
1.0,
|
152 |
-
|
153 |
False,
|
154 |
],
|
155 |
]
|
@@ -201,9 +210,9 @@ def create_demo(model: Model) -> gr.Blocks:
|
|
201 |
minimum=0,
|
202 |
maximum=MAX_SEED,
|
203 |
step=1,
|
204 |
-
value=
|
205 |
)
|
206 |
-
randomize_seed = gr.Checkbox(label="Randomize seed", value=
|
207 |
with gr.Column():
|
208 |
result = gr.Gallery(label="Result", columns=2, height=600, object_fit="scale-down", show_label=False)
|
209 |
|
@@ -212,6 +221,7 @@ def create_demo(model: Model) -> gr.Blocks:
|
|
212 |
inputs=[
|
213 |
image,
|
214 |
prompt,
|
|
|
215 |
adapter_name,
|
216 |
style,
|
217 |
guidance_scale,
|
|
|
51 |
def process_example(
|
52 |
image_url: str,
|
53 |
prompt: str,
|
54 |
+
negative_prompt: str,
|
55 |
adapter_name: str,
|
56 |
style_name: str,
|
57 |
guidance_scale: float,
|
|
|
63 |
return run(
|
64 |
image=image,
|
65 |
prompt=prompt,
|
66 |
+
negative_prompt=negative_prompt,
|
67 |
adapter_name=adapter_name,
|
68 |
style_name=style_name,
|
69 |
guidance_scale=guidance_scale,
|
|
|
76 |
[
|
77 |
"assets/org_canny.jpg",
|
78 |
"Mystical fairy in real, magic, 4k picture, high quality",
|
79 |
+
"extra digit, fewer digits, cropped, worst quality, low quality, glitch, deformed, mutated, ugly, disfigured",
|
80 |
"canny",
|
81 |
+
"(No style)",
|
82 |
+
7.5,
|
83 |
+
0.75,
|
84 |
+
42,
|
85 |
True,
|
86 |
],
|
87 |
[
|
88 |
"assets/org_sketch.png",
|
89 |
"a robot, mount fuji in the background, 4k photo, highly detailed",
|
90 |
+
"extra digit, fewer digits, cropped, worst quality, low quality, glitch, deformed, mutated, ugly, disfigured",
|
91 |
"sketch",
|
92 |
+
"(No style)",
|
93 |
+
7.5,
|
94 |
1.0,
|
95 |
+
42,
|
96 |
True,
|
97 |
],
|
98 |
[
|
99 |
"assets/org_lin.jpg",
|
100 |
"Ice dragon roar, 4k photo",
|
101 |
+
"extra digit, fewer digits, cropped, worst quality, low quality, glitch, deformed, mutated, ugly, disfigured",
|
102 |
"lineart",
|
103 |
+
"(No style)",
|
104 |
7.5,
|
105 |
0.8,
|
106 |
+
42,
|
107 |
True,
|
108 |
],
|
109 |
[
|
110 |
"assets/org_mid.jpg",
|
111 |
"A photo of a room, 4k photo, highly detailed",
|
112 |
+
"extra digit, fewer digits, cropped, worst quality, low quality, glitch, deformed, mutated, ugly, disfigured",
|
113 |
"depth-midas",
|
114 |
+
"(No style)",
|
115 |
+
7.5,
|
116 |
1.0,
|
117 |
+
42,
|
118 |
True,
|
119 |
],
|
120 |
[
|
121 |
"assets/org_zoe.jpg",
|
122 |
"A photo of a orchid, 4k photo, highly detailed",
|
123 |
+
"extra digit, fewer digits, cropped, worst quality, low quality, glitch, deformed, mutated, ugly, disfigured",
|
124 |
"depth-zoe",
|
125 |
+
"(No style)",
|
126 |
5.0,
|
127 |
1.0,
|
128 |
+
42,
|
129 |
True,
|
130 |
],
|
131 |
[
|
132 |
"assets/people.jpg",
|
133 |
"A couple, 4k photo, highly detailed",
|
134 |
+
"extra digit, fewer digits, cropped, worst quality, low quality, glitch, deformed, mutated, ugly, disfigured",
|
135 |
"openpose",
|
136 |
+
"(No style)",
|
137 |
5.0,
|
138 |
1.0,
|
139 |
+
42,
|
140 |
True,
|
141 |
],
|
142 |
[
|
143 |
"assets/depth-midas-image.png",
|
144 |
"stormtrooper lecture, 4k photo, highly detailed",
|
145 |
+
"extra digit, fewer digits, cropped, worst quality, low quality, glitch, deformed, mutated, ugly, disfigured",
|
146 |
"depth-midas",
|
147 |
+
"(No style)",
|
148 |
+
7.5,
|
149 |
1.0,
|
150 |
+
42,
|
151 |
False,
|
152 |
],
|
153 |
[
|
154 |
"assets/openpose-image.png",
|
155 |
"spiderman, 4k photo, highly detailed",
|
156 |
+
"extra digit, fewer digits, cropped, worst quality, low quality, glitch, deformed, mutated, ugly, disfigured",
|
157 |
"openpose",
|
158 |
+
"(No style)",
|
159 |
5.0,
|
160 |
1.0,
|
161 |
+
42,
|
162 |
False,
|
163 |
],
|
164 |
]
|
|
|
210 |
minimum=0,
|
211 |
maximum=MAX_SEED,
|
212 |
step=1,
|
213 |
+
value=42,
|
214 |
)
|
215 |
+
randomize_seed = gr.Checkbox(label="Randomize seed", value=False)
|
216 |
with gr.Column():
|
217 |
result = gr.Gallery(label="Result", columns=2, height=600, object_fit="scale-down", show_label=False)
|
218 |
|
|
|
221 |
inputs=[
|
222 |
image,
|
223 |
prompt,
|
224 |
+
negative_prompt,
|
225 |
adapter_name,
|
226 |
style,
|
227 |
guidance_scale,
|