smoothieAI
commited on
Commit
•
927e3ec
1
Parent(s):
0133547
Update pipeline.py
Browse files- pipeline.py +23 -21
pipeline.py
CHANGED
@@ -199,28 +199,30 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
|
|
199 |
):
|
200 |
super().__init__()
|
201 |
unet = UNetMotionModel.from_unet2d(unet, motion_adapter)
|
202 |
-
|
203 |
if controlnet is None:
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
|
|
|
|
224 |
self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1)
|
225 |
self.image_processor = VaeImageProcessor(vae_scale_factor=self.vae_scale_factor)
|
226 |
self.control_image_processor = VaeImageProcessor(
|
|
|
199 |
):
|
200 |
super().__init__()
|
201 |
unet = UNetMotionModel.from_unet2d(unet, motion_adapter)
|
202 |
+
|
203 |
if controlnet is None:
|
204 |
+
self.register_modules(
|
205 |
+
vae=vae,
|
206 |
+
text_encoder=text_encoder,
|
207 |
+
tokenizer=tokenizer,
|
208 |
+
unet=unet,
|
209 |
+
motion_adapter=motion_adapter,
|
210 |
+
scheduler=scheduler,
|
211 |
+
feature_extractor=feature_extractor,
|
212 |
+
image_encoder=image_encoder,
|
213 |
+
)
|
214 |
+
else:
|
215 |
+
self.register_modules(
|
216 |
+
vae=vae,
|
217 |
+
text_encoder=text_encoder,
|
218 |
+
tokenizer=tokenizer,
|
219 |
+
unet=unet,
|
220 |
+
motion_adapter=motion_adapter,
|
221 |
+
controlnet=controlnet,
|
222 |
+
scheduler=scheduler,
|
223 |
+
feature_extractor=feature_extractor,
|
224 |
+
image_encoder=image_encoder,
|
225 |
+
)
|
226 |
self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1)
|
227 |
self.image_processor = VaeImageProcessor(vae_scale_factor=self.vae_scale_factor)
|
228 |
self.control_image_processor = VaeImageProcessor(
|