hysts HF staff commited on
Commit
9d4657b
1 Parent(s): c9d5e42
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -43,6 +43,8 @@ def run(
43
  guidance_scale: float = 8.0,
44
  ) -> tuple[PIL.Image.Image | None, str]:
45
  generator = torch.Generator(device=device).manual_seed(seed)
 
 
46
  if mode == "t2i":
47
  pipe.set_text_to_image_mode()
48
  sample = pipe(prompt=prompt, num_inference_steps=num_steps, guidance_scale=guidance_scale, generator=generator)
 
43
  guidance_scale: float = 8.0,
44
  ) -> tuple[PIL.Image.Image | None, str]:
45
  generator = torch.Generator(device=device).manual_seed(seed)
46
+ if image is not None:
47
+ image = image.resize((512, 512))
48
  if mode == "t2i":
49
  pipe.set_text_to_image_mode()
50
  sample = pipe(prompt=prompt, num_inference_steps=num_steps, guidance_scale=guidance_scale, generator=generator)