Spaces:
Runtime error
Runtime error
lixiang46
commited on
Commit
•
9de30d4
1
Parent(s):
6155537
change seed
Browse files
app.py
CHANGED
@@ -77,7 +77,7 @@ MAX_IMAGE_SIZE = 1024
|
|
77 |
@spaces.GPU
|
78 |
def infer_depth(prompt,
|
79 |
image = None,
|
80 |
-
negative_prompt = "",
|
81 |
seed = 397886929,
|
82 |
randomize_seed = False,
|
83 |
guidance_scale = 6.0,
|
@@ -105,12 +105,12 @@ def infer_depth(prompt,
|
|
105 |
num_images_per_prompt=1,
|
106 |
generator=generator,
|
107 |
).images[0]
|
108 |
-
return [condi_img, image]
|
109 |
|
110 |
@spaces.GPU
|
111 |
def infer_canny(prompt,
|
112 |
image = None,
|
113 |
-
negative_prompt = "",
|
114 |
seed = 397886929,
|
115 |
randomize_seed = False,
|
116 |
guidance_scale = 6.0,
|
@@ -138,7 +138,7 @@ def infer_canny(prompt,
|
|
138 |
num_images_per_prompt=1,
|
139 |
generator=generator,
|
140 |
).images[0]
|
141 |
-
return [condi_img, image]
|
142 |
|
143 |
canny_examples = [
|
144 |
["一个漂亮的女孩,高品质,超清晰,色彩鲜艳,超高分辨率,最佳品质,8k,高清,4K",
|
@@ -244,6 +244,7 @@ with gr.Blocks(css=css) as Kolors:
|
|
244 |
|
245 |
with gr.Column(elem_id="col-right"):
|
246 |
result = gr.Gallery(label="Result", show_label=False, columns=2)
|
|
|
247 |
|
248 |
with gr.Row():
|
249 |
gr.Examples(
|
@@ -265,13 +266,13 @@ with gr.Blocks(css=css) as Kolors:
|
|
265 |
canny_button.click(
|
266 |
fn = infer_canny,
|
267 |
inputs = [prompt, image, negative_prompt, seed, randomize_seed, guidance_scale, num_inference_steps, controlnet_conditioning_scale, control_guidance_end, strength],
|
268 |
-
outputs = [result]
|
269 |
)
|
270 |
|
271 |
depth_button.click(
|
272 |
fn = infer_depth,
|
273 |
inputs = [prompt, image, negative_prompt, seed, randomize_seed, guidance_scale, num_inference_steps, controlnet_conditioning_scale, control_guidance_end, strength],
|
274 |
-
outputs = [result]
|
275 |
)
|
276 |
|
277 |
Kolors.queue().launch(debug=True)
|
|
|
77 |
@spaces.GPU
|
78 |
def infer_depth(prompt,
|
79 |
image = None,
|
80 |
+
negative_prompt = "nsfw,脸部阴影,低分辨率,jpeg伪影、模糊、糟糕,黑脸,霓虹灯",
|
81 |
seed = 397886929,
|
82 |
randomize_seed = False,
|
83 |
guidance_scale = 6.0,
|
|
|
105 |
num_images_per_prompt=1,
|
106 |
generator=generator,
|
107 |
).images[0]
|
108 |
+
return [condi_img, image], seed
|
109 |
|
110 |
@spaces.GPU
|
111 |
def infer_canny(prompt,
|
112 |
image = None,
|
113 |
+
negative_prompt = "nsfw,脸部阴影,低分辨率,jpeg伪影、模糊、糟糕,黑脸,霓虹灯",
|
114 |
seed = 397886929,
|
115 |
randomize_seed = False,
|
116 |
guidance_scale = 6.0,
|
|
|
138 |
num_images_per_prompt=1,
|
139 |
generator=generator,
|
140 |
).images[0]
|
141 |
+
return [condi_img, image], seed
|
142 |
|
143 |
canny_examples = [
|
144 |
["一个漂亮的女孩,高品质,超清晰,色彩鲜艳,超高分辨率,最佳品质,8k,高清,4K",
|
|
|
244 |
|
245 |
with gr.Column(elem_id="col-right"):
|
246 |
result = gr.Gallery(label="Result", show_label=False, columns=2)
|
247 |
+
seed_used = gr.Number(label="Seed Used")
|
248 |
|
249 |
with gr.Row():
|
250 |
gr.Examples(
|
|
|
266 |
canny_button.click(
|
267 |
fn = infer_canny,
|
268 |
inputs = [prompt, image, negative_prompt, seed, randomize_seed, guidance_scale, num_inference_steps, controlnet_conditioning_scale, control_guidance_end, strength],
|
269 |
+
outputs = [result, seed_used]
|
270 |
)
|
271 |
|
272 |
depth_button.click(
|
273 |
fn = infer_depth,
|
274 |
inputs = [prompt, image, negative_prompt, seed, randomize_seed, guidance_scale, num_inference_steps, controlnet_conditioning_scale, control_guidance_end, strength],
|
275 |
+
outputs = [result, seed_used]
|
276 |
)
|
277 |
|
278 |
Kolors.queue().launch(debug=True)
|