Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -23,17 +23,20 @@ def predict(prompt, ip_adapter_image, ip_adapter_scale=0.5, negative_prompt="",
|
|
23 |
if randomize_seed:
|
24 |
seed = random.randint(0, MAX_SEED)
|
25 |
|
26 |
-
if not center_crop:
|
27 |
-
|
28 |
-
else:
|
29 |
-
|
30 |
-
|
|
|
|
|
|
|
31 |
generator = torch.Generator(device="cuda").manual_seed(seed)
|
32 |
pipe.set_ip_adapter_scale([ip_adapter_scale])
|
33 |
|
34 |
image = pipe(
|
35 |
prompt=prompt,
|
36 |
-
ip_adapter_image=
|
37 |
negative_prompt=negative_prompt,
|
38 |
height=height,
|
39 |
width=width,
|
|
|
23 |
if randomize_seed:
|
24 |
seed = random.randint(0, MAX_SEED)
|
25 |
|
26 |
+
# if not center_crop:
|
27 |
+
# ip_adapter_image = [x.resize((224,224)) for x in ip_adapter_image[0]]
|
28 |
+
# else:
|
29 |
+
# ip_adapter_image = ip_adapter_image[0]
|
30 |
+
input_id_images = []
|
31 |
+
for img in ip_adapter_image:
|
32 |
+
input_id_images.append(load_image(img))
|
33 |
+
|
34 |
generator = torch.Generator(device="cuda").manual_seed(seed)
|
35 |
pipe.set_ip_adapter_scale([ip_adapter_scale])
|
36 |
|
37 |
image = pipe(
|
38 |
prompt=prompt,
|
39 |
+
ip_adapter_image=input_id_images,
|
40 |
negative_prompt=negative_prompt,
|
41 |
height=height,
|
42 |
width=width,
|