Spaces:
Paused
Paused
uuu
Browse files
app.py
CHANGED
@@ -65,14 +65,6 @@ pipe.init_ipadapter(
|
|
65 |
|
66 |
@spaces.GPU
|
67 |
def gui_generation(prompt, ref_img, guidance_scale, ipadapter_scale):
|
68 |
-
# Ensure reference image is in the correct format
|
69 |
-
if ref_img:
|
70 |
-
ref_img = ref_img.convert("RGB")
|
71 |
-
ref_img_tensor = torch.tensor(
|
72 |
-
np.array(ref_img), dtype=torch.bfloat16, device="cuda"
|
73 |
-
)
|
74 |
-
else:
|
75 |
-
raise ValueError("Reference image is required.")
|
76 |
|
77 |
# Ensure the pipeline runs with correct dtype and device
|
78 |
with torch.autocast("cuda", dtype=torch.bfloat16):
|
@@ -84,7 +76,7 @@ def gui_generation(prompt, ref_img, guidance_scale, ipadapter_scale):
|
|
84 |
num_inference_steps=24,
|
85 |
guidance_scale=guidance_scale,
|
86 |
generator=torch.Generator("cuda").manual_seed(42),
|
87 |
-
clip_image=
|
88 |
ipadapter_scale=ipadapter_scale,
|
89 |
).images[0]
|
90 |
|
|
|
65 |
|
66 |
@spaces.GPU
|
67 |
def gui_generation(prompt, ref_img, guidance_scale, ipadapter_scale):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
# Ensure the pipeline runs with correct dtype and device
|
70 |
with torch.autocast("cuda", dtype=torch.bfloat16):
|
|
|
76 |
num_inference_steps=24,
|
77 |
guidance_scale=guidance_scale,
|
78 |
generator=torch.Generator("cuda").manual_seed(42),
|
79 |
+
clip_image=ref_img,
|
80 |
ipadapter_scale=ipadapter_scale,
|
81 |
).images[0]
|
82 |
|