bmarci commited on
Commit
a9f11f2
·
1 Parent(s): 89a49c1
Files changed (1) hide show
  1. app.py +2 -11
app.py CHANGED
@@ -43,22 +43,13 @@ def infer(
43
  if prompt in [None, ""]:
44
  gr.Warning("⚠️ Please enter a prompt!")
45
  return None
46
-
47
- if ref is not None:
48
- editing_caption = "<image>" + prompt
49
- input_image = ref
50
- input_image = center_crop_arr_with_buckets(input_image, buckets=[512])
51
- else:
52
- editing_caption = prompt
53
- input_image = None
54
- img_cfg = 1.0
55
-
56
  image = pipeline.generate_image(
57
  captions=editing_caption,
58
  num_images_per_caption=1,
59
  positive_prompt=positive_prompt,
60
  negative_prompt=negative_prompt,
61
- hw=(input_image.size[1], input_image.size[0]),
62
  cfg=text_cfg,
63
  cfg_img=img_cfg,
64
  cfg_schedule="constant",
 
43
  if prompt in [None, ""]:
44
  gr.Warning("⚠️ Please enter a prompt!")
45
  return None
46
+ IMG_SIZE = 512
 
 
 
 
 
 
 
 
 
47
  image = pipeline.generate_image(
48
  captions=editing_caption,
49
  num_images_per_caption=1,
50
  positive_prompt=positive_prompt,
51
  negative_prompt=negative_prompt,
52
+ hw=(IMG_SIZE, IMG_SIZE),
53
  cfg=text_cfg,
54
  cfg_img=img_cfg,
55
  cfg_schedule="constant",