Spaces:
Running
on
Zero
Running
on
Zero
gen3
Browse files
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=(
|
| 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",
|