Spaces:
Runtime error
Runtime error
Commit
·
31ff076
1
Parent(s):
15b949a
修复img2img的报错 (#4)
Browse files- 修复img2img的报错 (ec8d02b4e0cd0d97a496d618d7b69be6eb48de26)
Co-authored-by: HaloMaster <HaloMaster@users.noreply.huggingface.co>
app.py
CHANGED
@@ -25,7 +25,7 @@ pipe_img2img = StableDiffusionImg2ImgPipeline(**pipe_text2img.components).to(dev
|
|
25 |
def infer_text2img(prompt, guide, steps, width, height, image_in, strength):
|
26 |
if image_in is not None:
|
27 |
init_image = image_in.convert("RGB").resize((width, height))
|
28 |
-
output = pipe_img2img(prompt,
|
29 |
else:
|
30 |
output = pipe_text2img(prompt, width=width, height=height, guidance_scale=guide, num_inference_steps=steps,)
|
31 |
image = output.images[0]
|
|
|
25 |
def infer_text2img(prompt, guide, steps, width, height, image_in, strength):
|
26 |
if image_in is not None:
|
27 |
init_image = image_in.convert("RGB").resize((width, height))
|
28 |
+
output = pipe_img2img(prompt, image=init_image, strength=strength, guidance_scale=guide, num_inference_steps=steps)
|
29 |
else:
|
30 |
output = pipe_text2img(prompt, width=width, height=height, guidance_scale=guide, num_inference_steps=steps,)
|
31 |
image = output.images[0]
|