Text-to-Video
Diffusers
Safetensors
modular_diffusers
vae
ltx2.3
lightricks
video-to-video
text-to-audio
Instructions to use AINovice2005/pruna-vaed-modular-diffusers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use AINovice2005/pruna-vaed-modular-diffusers with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("AINovice2005/pruna-vaed-modular-diffusers", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
| from diffusers.modular_pipelines import ModularPipelineBlocks, PipelineState | |
| from diffusers.modular_pipelines.modular_pipeline_utils import ( | |
| ComponentSpec, | |
| InputParam, | |
| OutputParam, | |
| ) | |
| from .modeling_prunavae import PrunaAutoencoderKLLTX2Video | |
| class LoadPrunaVAE(ModularPipelineBlocks): | |
| model_name = "PrunaVAED" | |
| def __init__( | |
| self, | |
| pretrained_model_name_or_path: str = "AINovice2005/pruna-vaed-modular-diffusers", | |
| subfolder: str | None = None, | |
| revision: str | None = None, | |
| variant: str | None = None, | |
| ): | |
| super().__init__() | |
| self.pretrained_model_name_or_path = pretrained_model_name_or_path | |
| self.subfolder = subfolder | |
| self.revision = revision | |
| self.variant = variant | |
| def description(self) -> str: | |
| return ( | |
| "Loads a PrunaAutoencoderKLLTX2Video from the Hugging Face Hub " | |
| "and exposes it as `components.vae`." | |
| ) | |
| def expected_components(self): | |
| return [ | |
| ComponentSpec( | |
| "vae", | |
| PrunaAutoencoderKLLTX2Video, | |
| pretrained_model_name_or_path=self.pretrained_model_name_or_path, | |
| subfolder=self.subfolder, | |
| revision=self.revision, | |
| variant=self.variant, | |
| ) | |
| ] | |
| def inputs(self): | |
| return [] | |
| def intermediate_outputs(self): | |
| return [] | |
| def __call__(self, components, state): | |
| # Nothing to compute here -- this block's only role is to make # `components.vae` | |
| #(a PrunaAutoencoderKLLTX2Video) available to # every block downstream in the pipeline. | |
| #Blocks that actually # need it (e.g. a decode step) read it directly off `components`, # not off `state`. | |
| return components, state |