Vignesh455 commited on
Commit
7cbef73
·
verified ·
1 Parent(s): aa900e5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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]