Refer image resize
Browse files
app.py
CHANGED
|
@@ -24,17 +24,19 @@ MAX_IMAGE_SIZE = 1024
|
|
| 24 |
@spaces.GPU
|
| 25 |
def infer(prompt, refer_image, height, width):
|
| 26 |
|
|
|
|
|
|
|
| 27 |
image = pipeline(
|
| 28 |
prompt=prompt,
|
| 29 |
# guidance_scale=guidance_scale,
|
| 30 |
# num_inference_steps=num_inference_steps,
|
| 31 |
width=width,
|
| 32 |
height=height,
|
| 33 |
-
image=
|
| 34 |
# generator=generator
|
| 35 |
).images[0]
|
| 36 |
|
| 37 |
-
return
|
| 38 |
|
| 39 |
|
| 40 |
examples = [
|
|
|
|
| 24 |
@spaces.GPU
|
| 25 |
def infer(prompt, refer_image, height, width):
|
| 26 |
|
| 27 |
+
init_image = refer_image.resize((1024, 1024))
|
| 28 |
+
|
| 29 |
image = pipeline(
|
| 30 |
prompt=prompt,
|
| 31 |
# guidance_scale=guidance_scale,
|
| 32 |
# num_inference_steps=num_inference_steps,
|
| 33 |
width=width,
|
| 34 |
height=height,
|
| 35 |
+
image=init_image
|
| 36 |
# generator=generator
|
| 37 |
).images[0]
|
| 38 |
|
| 39 |
+
return image
|
| 40 |
|
| 41 |
|
| 42 |
examples = [
|