Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -76,10 +76,14 @@ def get_ControlNetXS(base_model, cnxs_path, device, size_ratio=0.125, weight_dty
|
|
76 |
|
77 |
return ControlNetXS
|
78 |
|
|
|
79 |
ControlNetXS = get_ControlNetXS(base_model, cnxs_path, device, size_ratio=0.125, weight_dtype=weight_dtype)
|
|
|
80 |
vae = AutoencoderKL.from_pretrained(vae_path)
|
|
|
|
|
81 |
pipe = StableDiffusionXLInstantIDXSPipeline.from_pretrained(
|
82 |
-
|
83 |
vae=vae,
|
84 |
unet=ControlNetXS,
|
85 |
controlnet=None,
|
@@ -87,11 +91,13 @@ pipe = StableDiffusionXLInstantIDXSPipeline.from_pretrained(
|
|
87 |
)
|
88 |
|
89 |
pipe.cuda(device=device, dtype=weight_dtype, use_xformers=True)
|
|
|
|
|
90 |
pipe.load_ip_adapter(image_proj_path, cross_attn_path)
|
91 |
|
92 |
pipe.scheduler = diffusers.EulerDiscreteScheduler.from_config(pipe.scheduler.config)
|
93 |
pipe.unet.config.ctrl_learn_time_embedding = True
|
94 |
-
pipe = pipe.to(
|
95 |
|
96 |
|
97 |
|
|
|
76 |
|
77 |
return ControlNetXS
|
78 |
|
79 |
+
print('Get ControlNetXS...')
|
80 |
ControlNetXS = get_ControlNetXS(base_model, cnxs_path, device, size_ratio=0.125, weight_dtype=weight_dtype)
|
81 |
+
|
82 |
vae = AutoencoderKL.from_pretrained(vae_path)
|
83 |
+
|
84 |
+
print('Get Pipeline...')
|
85 |
pipe = StableDiffusionXLInstantIDXSPipeline.from_pretrained(
|
86 |
+
base_model,
|
87 |
vae=vae,
|
88 |
unet=ControlNetXS,
|
89 |
controlnet=None,
|
|
|
91 |
)
|
92 |
|
93 |
pipe.cuda(device=device, dtype=weight_dtype, use_xformers=True)
|
94 |
+
|
95 |
+
print('Load IP-Adapter')
|
96 |
pipe.load_ip_adapter(image_proj_path, cross_attn_path)
|
97 |
|
98 |
pipe.scheduler = diffusers.EulerDiscreteScheduler.from_config(pipe.scheduler.config)
|
99 |
pipe.unet.config.ctrl_learn_time_embedding = True
|
100 |
+
pipe = pipe.to(device)
|
101 |
|
102 |
|
103 |
|