Spaces:
Runtime error
Runtime error
image var
Browse files
app.py
CHANGED
@@ -25,7 +25,7 @@ def image_grid(imgs, rows, cols):
|
|
25 |
|
26 |
|
27 |
def predict(dict, prompt):
|
28 |
-
image =
|
29 |
mask_image = dict['mask'].convert("RGB").resize((512, 512))
|
30 |
images = pipe(prompt=prompt, image=image, mask_image=mask_image).images
|
31 |
return(images[0])
|
@@ -45,6 +45,7 @@ pipe = StableDiffusionInpaintPipeline.from_pretrained(
|
|
45 |
).to(device)
|
46 |
|
47 |
img_url = "https://cdn.faire.com/fastly/893b071985d70819da5f0d485f1b1bb97ee4f16a6e14ef1bdd4a086b3588be58.png" # wino
|
|
|
48 |
inverted_mask_image = remove(data = image, only_mask = True)
|
49 |
mask_image = PIL.ImageOps.invert(inverted_mask_image)
|
50 |
prompt = "crazy portal universe"
|
|
|
25 |
|
26 |
|
27 |
def predict(dict, prompt):
|
28 |
+
image = dict['image'].convert("RGB").resize((512, 512))
|
29 |
mask_image = dict['mask'].convert("RGB").resize((512, 512))
|
30 |
images = pipe(prompt=prompt, image=image, mask_image=mask_image).images
|
31 |
return(images[0])
|
|
|
45 |
).to(device)
|
46 |
|
47 |
img_url = "https://cdn.faire.com/fastly/893b071985d70819da5f0d485f1b1bb97ee4f16a6e14ef1bdd4a086b3588be58.png" # wino
|
48 |
+
image = download_image(img_url).resize((512, 512))
|
49 |
inverted_mask_image = remove(data = image, only_mask = True)
|
50 |
mask_image = PIL.ImageOps.invert(inverted_mask_image)
|
51 |
prompt = "crazy portal universe"
|