smoothieAI
commited on
Commit
•
063ff12
1
Parent(s):
e4e1338
Update pipeline.py
Browse files- pipeline.py +11 -25
pipeline.py
CHANGED
@@ -143,12 +143,10 @@ def tensor2vid(video: torch.Tensor, processor, output_type="np"):
|
|
143 |
|
144 |
return outputs
|
145 |
|
146 |
-
|
147 |
@dataclass
|
148 |
class AnimateDiffPipelineOutput(BaseOutput):
|
149 |
frames: Union[torch.Tensor, np.ndarray]
|
150 |
|
151 |
-
|
152 |
class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdapterMixin, LoraLoaderMixin):
|
153 |
r"""
|
154 |
Pipeline for text-to-video generation.
|
@@ -200,29 +198,17 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
|
|
200 |
super().__init__()
|
201 |
unet = UNetMotionModel.from_unet2d(unet, motion_adapter)
|
202 |
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
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(
|
|
|
143 |
|
144 |
return outputs
|
145 |
|
|
|
146 |
@dataclass
|
147 |
class AnimateDiffPipelineOutput(BaseOutput):
|
148 |
frames: Union[torch.Tensor, np.ndarray]
|
149 |
|
|
|
150 |
class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdapterMixin, LoraLoaderMixin):
|
151 |
r"""
|
152 |
Pipeline for text-to-video generation.
|
|
|
198 |
super().__init__()
|
199 |
unet = UNetMotionModel.from_unet2d(unet, motion_adapter)
|
200 |
|
201 |
+
self.register_modules(
|
202 |
+
vae=vae,
|
203 |
+
text_encoder=text_encoder,
|
204 |
+
tokenizer=tokenizer,
|
205 |
+
unet=unet,
|
206 |
+
motion_adapter=motion_adapter,
|
207 |
+
controlnet=controlnet,
|
208 |
+
scheduler=scheduler,
|
209 |
+
feature_extractor=feature_extractor,
|
210 |
+
image_encoder=image_encoder,
|
211 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1)
|
213 |
self.image_processor = VaeImageProcessor(vae_scale_factor=self.vae_scale_factor)
|
214 |
self.control_image_processor = VaeImageProcessor(
|