"pytorch/vscode:/vscode.git/clone" did not exist on "0d9c540f68fa5f1f0ba86bb9104c4ac66ccf7035"
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,7 +65,11 @@ def save_image(img):
def run(image, prompt: str, prompt_template: str, sketch_guidance: float, seed: int) -> tuple[Image, str]:
print(f"Prompt: {prompt}")
image_numpy = np.array(image["composite"].convert("RGB"))
if image["composite"] is None:
image_numpy = np.array(blank_image.convert("RGB"))
else:
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):
return blank_image, "Please input the prompt or draw something."
......
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