cocktailpeanut commited on
Commit
97e7693
·
1 Parent(s): 706b887
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -55,9 +55,12 @@ def run_normal(prompt, negative_prompt="", guidance_scale=7, progress=gr.Progres
55
  #@spaces.GPU
56
  def run_edit(image, prompt, resolution, negative_prompt="", guidance_scale=7, progress=gr.Progress(track_tqdm=True)):
57
  #resolution = 1024
58
- image.thumbnail((resolution, resolution), Image.LANCZOS)
 
59
  #image.resize((resolution, resolution))
60
- return pipe_edit(prompt=prompt,image=image,height=resolution,width=resolution,negative_prompt=negative_prompt, guidance_scale=guidance_scale,num_inference_steps=20).images[0]
 
 
61
  css = '''
62
  .gradio-container{
63
  max-width: 768px !important;
 
55
  #@spaces.GPU
56
  def run_edit(image, prompt, resolution, negative_prompt="", guidance_scale=7, progress=gr.Progress(track_tqdm=True)):
57
  #resolution = 1024
58
+ print(f"width={image.width}, height={image.height}")
59
+ image.thumbnail((resolution, resolution), Image.Resampling.LANCZOS)
60
  #image.resize((resolution, resolution))
61
+ #return pipe_edit(prompt=prompt,image=image,height=resolution,width=resolution,negative_prompt=negative_prompt, guidance_scale=guidance_scale,num_inference_steps=20).images[0]
62
+ print(f"width={image.width}, height={image.height}")
63
+ return pipe_edit(prompt=prompt,image=image,height=image.height,width=image.width,negative_prompt=negative_prompt, guidance_scale=guidance_scale,num_inference_steps=20).images[0]
64
  css = '''
65
  .gradio-container{
66
  max-width: 768px !important;