Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import torch
|
|
| 4 |
from diffusers import AutoPipelineForInpainting, UNet2DConditionModel
|
| 5 |
import diffusers
|
| 6 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
|
|
|
| 7 |
|
| 8 |
pipe = AutoPipelineForInpainting.from_pretrained("SG161222/Realistic_Vision_V5.0_noVAE").to("cuda")
|
| 9 |
|
|
@@ -16,7 +17,7 @@ def read_content(file_path: str) -> str:
|
|
| 16 |
return content
|
| 17 |
|
| 18 |
def predict(dict, prompt="", negative_prompt="", guidance_scale=7.5, steps=20, strength=1.0, scheduler="EulerDiscreteScheduler"):
|
| 19 |
-
original_width, original_height = dict["image"].shape[1:]
|
| 20 |
if negative_prompt == "":
|
| 21 |
negative_prompt = None
|
| 22 |
scheduler_class_name = scheduler.split("-")[0]
|
|
|
|
| 4 |
from diffusers import AutoPipelineForInpainting, UNet2DConditionModel
|
| 5 |
import diffusers
|
| 6 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
| 7 |
+
from PIL import Image
|
| 8 |
|
| 9 |
pipe = AutoPipelineForInpainting.from_pretrained("SG161222/Realistic_Vision_V5.0_noVAE").to("cuda")
|
| 10 |
|
|
|
|
| 17 |
return content
|
| 18 |
|
| 19 |
def predict(dict, prompt="", negative_prompt="", guidance_scale=7.5, steps=20, strength=1.0, scheduler="EulerDiscreteScheduler"):
|
| 20 |
+
original_width, original_height = Image.open(dict["image"]).shape[1:]
|
| 21 |
if negative_prompt == "":
|
| 22 |
negative_prompt = None
|
| 23 |
scheduler_class_name = scheduler.split("-")[0]
|