Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -14,9 +14,10 @@ def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
|
|
14 |
seed = random.randint(0, 2000)
|
15 |
return seed
|
16 |
|
17 |
-
device = torch.device('cuda
|
18 |
-
|
19 |
-
pipeline.
|
|
|
20 |
|
21 |
@spaces.GPU()
|
22 |
def create_image(image_pil,
|
|
|
14 |
seed = random.randint(0, 2000)
|
15 |
return seed
|
16 |
|
17 |
+
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
18 |
+
dtype = torch.float16 if torch.cuda.is_available() else torch.float32
|
19 |
+
pipeline = AutoPipelineForText2Image.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=dtype).to(device)
|
20 |
+
pipeline.load_ip_adapter("h94/IP-Adapter", subfolder="sdxl_models", weight_name="ip-adapter_sdxl.bin", device=device, dtype=dtype)
|
21 |
|
22 |
@spaces.GPU()
|
23 |
def create_image(image_pil,
|