Unverified Commit b2a817c8 authored by Muyang Li's avatar Muyang Li Committed by GitHub
Browse files

fix: fix the pix2pix-turbo demo (#373)

parent 3bef6f22
...@@ -65,6 +65,10 @@ def save_image(img): ...@@ -65,6 +65,10 @@ def save_image(img):
def run(image, prompt: str, prompt_template: str, sketch_guidance: float, seed: int) -> tuple[Image, str]: def run(image, prompt: str, prompt_template: str, sketch_guidance: float, seed: int) -> tuple[Image, str]:
print(f"Prompt: {prompt}") print(f"Prompt: {prompt}")
if image["composite"] is None:
image_numpy = np.array(blank_image.convert("RGB"))
else:
image_numpy = np.array(image["composite"].convert("RGB")) image_numpy = np.array(image["composite"].convert("RGB"))
if prompt.strip() == "" and (np.sum(image_numpy == 255) >= 3145628 or np.sum(image_numpy == 0) >= 3145628): if prompt.strip() == "" and (np.sum(image_numpy == 255) >= 3145628 or np.sum(image_numpy == 0) >= 3145628):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment