Spaces:
Runtime error
Runtime error
will fix haha
Browse files
app.py
CHANGED
|
@@ -40,13 +40,14 @@ unet.load_state_dict(load_file(hf_hub_download(sdxl_lightening, ckpt), device="c
|
|
| 40 |
pipe = SDEmb.from_pretrained(model_id, unet=unet, torch_dtype=torch.float16, variant="fp16").to("cuda")
|
| 41 |
pipe.vae = AutoencoderTiny.from_pretrained("madebyollin/taesdxl", torch_dtype=torch.float16)
|
| 42 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
|
| 43 |
-
pipe.to(device='cuda')
|
| 44 |
|
| 45 |
-
|
|
|
|
| 46 |
pipe.unet._load_ip_adapter_weights(torch.load(hf_hub_download('h94/IP-Adapter', 'sdxl_models/ip-adapter_sdxl.bin'), map_location="cpu"))
|
| 47 |
pipe.register_modules(image_encoder = image_encoder)
|
|
|
|
| 48 |
|
| 49 |
-
|
| 50 |
|
| 51 |
output_hidden_state = True
|
| 52 |
#######################
|
|
|
|
| 40 |
pipe = SDEmb.from_pretrained(model_id, unet=unet, torch_dtype=torch.float16, variant="fp16").to("cuda")
|
| 41 |
pipe.vae = AutoencoderTiny.from_pretrained("madebyollin/taesdxl", torch_dtype=torch.float16)
|
| 42 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
|
|
|
|
| 43 |
|
| 44 |
+
image_preproc = CLIPImageProcessor.from_pretrained('runwayml/stable-diffusion-v1-5', subfolder='feature_extractor')
|
| 45 |
+
image_encoder = CLIPVisionModelWithProjection.from_pretrained('h94/IP-Adapter', subfolder='sdxl_models/image_encoder', torch_dtype=torch.float16)
|
| 46 |
pipe.unet._load_ip_adapter_weights(torch.load(hf_hub_download('h94/IP-Adapter', 'sdxl_models/ip-adapter_sdxl.bin'), map_location="cpu"))
|
| 47 |
pipe.register_modules(image_encoder = image_encoder)
|
| 48 |
+
pipe.register_modules(feature_extractor = image_preproc)
|
| 49 |
|
| 50 |
+
pipe.to(device='cuda')
|
| 51 |
|
| 52 |
output_hidden_state = True
|
| 53 |
#######################
|