smoothieAI commited on
Commit
927e3ec
1 Parent(s): 0133547

Update pipeline.py

Browse files
Files changed (1) hide show
  1. 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
- if hasattr(self.pipe, "controlnet"):print("has controlnet")
203
  if controlnet is None:
204
- if hasattr(self, "controlnet"):delattr(self, "controlnet")
205
-
206
- # print all the attributes
207
- print("Attributes:")
208
- for attr in dir(self):
209
- print(attr)
210
-
211
- print("contorlnet still exists:", hasattr(self, "controlnet"))
212
-
213
- self.register_modules(
214
- vae=vae,
215
- text_encoder=text_encoder,
216
- tokenizer=tokenizer,
217
- unet=unet,
218
- motion_adapter=motion_adapter,
219
- controlnet=controlnet,
220
- scheduler=scheduler,
221
- feature_extractor=feature_extractor,
222
- image_encoder=image_encoder,
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(