Spaces:
Running
on
Zero
Running
on
Zero
Commit
•
9d21a93
1
Parent(s):
b93d27c
Update app.py
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ image_encoder = CLIPVisionModelWithProjection.from_pretrained(
|
|
35 |
).to(dtype=torch.float16, device=device)
|
36 |
|
37 |
ip_img_size = 336
|
38 |
-
clip_image_processor = CLIPImageProcessor(size=ip_img_size, crop_size=ip_img_size)
|
39 |
|
40 |
pipe = StableDiffusionXLPipeline(
|
41 |
vae=vae,
|
@@ -64,7 +64,7 @@ def infer(prompt, ip_adapter_image, negative_prompt="", seed=42, randomize_seed=
|
|
64 |
if randomize_seed:
|
65 |
seed = random.randint(0, MAX_SEED)
|
66 |
|
67 |
-
generator = torch.Generator(device="
|
68 |
|
69 |
pipe.set_ip_adapter_scale([ip_adapter_scale])
|
70 |
|
|
|
35 |
).to(dtype=torch.float16, device=device)
|
36 |
|
37 |
ip_img_size = 336
|
38 |
+
clip_image_processor = CLIPImageProcessor(size=ip_img_size, crop_size=ip_img_size)
|
39 |
|
40 |
pipe = StableDiffusionXLPipeline(
|
41 |
vae=vae,
|
|
|
64 |
if randomize_seed:
|
65 |
seed = random.randint(0, MAX_SEED)
|
66 |
|
67 |
+
generator = torch.Generator(device="cuda").manual_seed(seed)
|
68 |
|
69 |
pipe.set_ip_adapter_scale([ip_adapter_scale])
|
70 |
|