source
stringclasses
273 values
url
stringlengths
47
172
file_type
stringclasses
1 value
chunk
stringlengths
1
512
chunk_id
stringlengths
5
9
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/loading.md
https://huggingface.co/docs/diffusers/en/using-diffusers/loading/#diffusionpipeline-explained
.md
- `"feature_extractor"`: a [`~transformers.CLIPImageProcessor`] from πŸ€— Transformers. - `"safety_checker"`: a [component](https://github.com/huggingface/diffusers/blob/e55687e1e15407f60f32242027b7bb8170e58266/src/diffusers/pipelines/stable_diffusion/safety_checker.py#L32) for screening against harmful content. - `"sche...
73_10_4
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/loading.md
https://huggingface.co/docs/diffusers/en/using-diffusers/loading/#diffusionpipeline-explained
.md
- `"tokenizer"`: a [`~transformers.CLIPTokenizer`] from πŸ€— Transformers. - `"unet"`: an instance of [`UNet2DConditionModel`]. - `"vae"`: an instance of [`AutoencoderKL`]. ```json StableDiffusionPipeline { "feature_extractor": [ "transformers", "CLIPImageProcessor" ], "safety_checker": [ "stable_diffusion", "StableDif...
73_10_5
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/loading.md
https://huggingface.co/docs/diffusers/en/using-diffusers/loading/#diffusionpipeline-explained
.md
], "text_encoder": [ "transformers", "CLIPTextModel" ], "tokenizer": [ "transformers", "CLIPTokenizer" ], "unet": [ "diffusers", "UNet2DConditionModel" ], "vae": [ "diffusers", "AutoencoderKL" ] } ``` Compare the components of the pipeline instance to the [`stable-diffusion-v1-5/stable-diffusion-v1-5`](https://huggin...
73_10_6
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/loading.md
https://huggingface.co/docs/diffusers/en/using-diffusers/loading/#diffusionpipeline-explained
.md
``` . β”œβ”€β”€ feature_extractor β”‚ └── preprocessor_config.json β”œβ”€β”€ model_index.json β”œβ”€β”€ safety_checker β”‚ β”œβ”€β”€ config.json | β”œβ”€β”€ model.fp16.safetensors β”‚ β”œβ”€β”€ model.safetensors β”‚ β”œβ”€β”€ pytorch_model.bin | └── pytorch_model.fp16.bin β”œβ”€β”€ scheduler β”‚ └── scheduler_config.json β”œβ”€β”€ text_encoder β”‚ β”œβ”€β”€ config.json | β”œβ”€β”€ mode...
73_10_7
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/loading.md
https://huggingface.co/docs/diffusers/en/using-diffusers/loading/#diffusionpipeline-explained
.md
| └── pytorch_model.fp16.bin β”œβ”€β”€ tokenizer β”‚ β”œβ”€β”€ merges.txt β”‚ β”œβ”€β”€ special_tokens_map.json β”‚ β”œβ”€β”€ tokenizer_config.json β”‚ └── vocab.json β”œβ”€β”€ unet β”‚ β”œβ”€β”€ config.json β”‚ β”œβ”€β”€ diffusion_pytorch_model.bin | |── diffusion_pytorch_model.fp16.bin β”‚ |── diffusion_pytorch_model.f16.safetensors β”‚ |── diffusion_pytorch_model.n...
73_10_8
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/loading.md
https://huggingface.co/docs/diffusers/en/using-diffusers/loading/#diffusionpipeline-explained
.md
β”‚ └── diffusion_pytorch_model.safetensors |── vae . β”œβ”€β”€ config.json . β”œβ”€β”€ diffusion_pytorch_model.bin β”œβ”€β”€ diffusion_pytorch_model.fp16.bin β”œβ”€β”€ diffusion_pytorch_model.fp16.safetensors └── diffusion_pytorch_model.safetensors ``` You can access each of the components of the pipeline as an attribute to view its co...
73_10_9
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/loading.md
https://huggingface.co/docs/diffusers/en/using-diffusers/loading/#diffusionpipeline-explained
.md
```py pipeline.tokenizer CLIPTokenizer( name_or_path="/root/.cache/huggingface/hub/models--runwayml--stable-diffusion-v1-5/snapshots/39593d5650112b4cc580433f6b0435385882d819/tokenizer", vocab_size=49408, model_max_length=77, is_fast=False, padding_side="right", truncation_side="right", special_tokens={ "bos_token": Add...
73_10_10
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/loading.md
https://huggingface.co/docs/diffusers/en/using-diffusers/loading/#diffusionpipeline-explained
.md
special_tokens={ "bos_token": AddedToken("<|startoftext|>", rstrip=False, lstrip=False, single_word=False, normalized=True), "eos_token": AddedToken("<|endoftext|>", rstrip=False, lstrip=False, single_word=False, normalized=True), "unk_token": AddedToken("<|endoftext|>", rstrip=False, lstrip=False, single_word=False, n...
73_10_11
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/loading.md
https://huggingface.co/docs/diffusers/en/using-diffusers/loading/#diffusionpipeline-explained
.md
"pad_token": "<|endoftext|>", }, clean_up_tokenization_spaces=True ) ``` Every pipeline expects a [`model_index.json`](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5/blob/main/model_index.json) file that tells the [`DiffusionPipeline`]: - which pipeline class to load from `_class_name` - which v...
73_10_12
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/loading.md
https://huggingface.co/docs/diffusers/en/using-diffusers/loading/#diffusionpipeline-explained
.md
- which version of 🧨 Diffusers was used to create the model in `_diffusers_version` - what components from which library are stored in the subfolders (`name` corresponds to the component and subfolder name, `library` corresponds to the name of the library to load the class from, and `class` corresponds to the class na...
73_10_13
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/loading.md
https://huggingface.co/docs/diffusers/en/using-diffusers/loading/#diffusionpipeline-explained
.md
"feature_extractor": [ "transformers", "CLIPImageProcessor" ], "safety_checker": [ "stable_diffusion", "StableDiffusionSafetyChecker" ], "scheduler": [ "diffusers", "PNDMScheduler" ], "text_encoder": [ "transformers", "CLIPTextModel" ], "tokenizer": [ "transformers", "CLIPTokenizer" ], "unet": [ "diffusers", "UNet2DCon...
73_10_14
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/
.md
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agr...
74_0_0
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/
.md
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->
74_0_1
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
Video generation models include a temporal dimension to bring images, or frames, together to create a video. These models are trained on large-scale datasets of high-quality text-video pairs to learn how to combine the modalities to ensure the generated video is coherent and realistic. [Explore](https://huggingface.c...
74_1_0
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
<hfoptions id="popular-models"> <hfoption id="CogVideoX"> [CogVideoX](https://huggingface.co/collections/THUDM/cogvideo-66c08e62f1685a3ade464cce) uses a 3D causal Variational Autoencoder (VAE) to compress videos along the spatial and temporal dimensions, and it includes a stack of expert transformer blocks with a 3D ...
74_1_1
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
The CogVideoX family also includes models capable of generating videos from images and videos in addition to text. The image-to-video models are indicated by **I2V** in the checkpoint name, and they should be used with the [`CogVideoXImageToVideoPipeline`]. The regular checkpoints support video-to-video through the [`C...
74_1_2
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
The example below demonstrates how to generate a video from an image and text prompt with [THUDM/CogVideoX-5b-I2V](https://huggingface.co/THUDM/CogVideoX-5b-I2V). ```py import torch from diffusers import CogVideoXImageToVideoPipeline from diffusers.utils import export_to_video, load_image
74_1_3
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
prompt = "A vast, shimmering ocean flows gracefully under a twilight sky, its waves undulating in a mesmerizing dance of blues and greens. The surface glints with the last rays of the setting sun, casting golden highlights that ripple across the water. Seagulls soar above, their cries blending with the gentle roar of t...
74_1_4
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
the sky in a seamless blend of hues. Close-ups reveal the intricate patterns of the waves, capturing the fluidity and dynamic beauty of the sea in motion."
74_1_5
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
image = load_image(image="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cogvideox/cogvideox_rocket.png") pipe = CogVideoXImageToVideoPipeline.from_pretrained( "THUDM/CogVideoX-5b-I2V", torch_dtype=torch.bfloat16 )
74_1_6
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
# reduce memory requirements pipe.vae.enable_tiling() pipe.vae.enable_slicing()
74_1_7
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
video = pipe( prompt=prompt, image=image, num_videos_per_prompt=1, num_inference_steps=50, num_frames=49, guidance_scale=6, generator=torch.Generator(device="cuda").manual_seed(42), ).frames[0] export_to_video(video, "output.mp4", fps=8) ``` <div class="flex gap-4"> <div> <img class="rounded-xl" src="https://huggingf...
74_1_8
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
<figcaption class="mt-2 text-center text-sm text-gray-500">initial image</figcaption> </div> <div> <img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cogvideox/cogvideox_outrocket.gif"/> <figcaption class="mt-2 text-center text-sm text-gray-500">generate...
74_1_9
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
</div> </div> </hfoption> <hfoption id="HunyuanVideo"> > [!TIP] > HunyuanVideo is a 13B parameter model and requires a lot of memory. Refer to the HunyuanVideo [Quantization](../api/pipelines/hunyuan_video#quantization) guide to learn how to quantize the model. CogVideoX and LTX-Video are more lightweight options t...
74_1_10
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
[HunyuanVideo](https://huggingface.co/tencent/HunyuanVideo) features a dual-stream to single-stream diffusion transformer (DiT) for learning video and text tokens separately, and then subsequently concatenating the video and text tokens to combine their information. A single multimodal large language model (MLLM) serve...
74_1_11
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
```py import torch from diffusers import HunyuanVideoPipeline, HunyuanVideoTransformer3DModel from diffusers.utils import export_to_video
74_1_12
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
transformer = HunyuanVideoTransformer3DModel.from_pretrained( "hunyuanvideo-community/HunyuanVideo", subfolder="transformer", torch_dtype=torch.bfloat16 ) pipe = HunyuanVideoPipeline.from_pretrained( "hunyuanvideo-community/HunyuanVideo", transformer=transformer, torch_dtype=torch.float16 ) # reduce memory requirement...
74_1_13
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
video = pipe( prompt="A cat walks on the grass, realistic", height=320, width=512, num_frames=61, num_inference_steps=30, ).frames[0] export_to_video(video, "output.mp4", fps=15) ``` <div class="flex justify-center"> <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/hun...
74_1_14
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
</div> </hfoption> <hfoption id="LTX-Video"> [LTX-Video (LTXV)](https://huggingface.co/Lightricks/LTX-Video) is a diffusion transformer (DiT) with a focus on speed. It generates 768x512 resolution videos at 24 frames per second (fps), enabling near real-time generation of high-quality videos. LTXV is relatively lig...
74_1_15
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
```py import torch from diffusers import LTXPipeline from diffusers.utils import export_to_video
74_1_16
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
pipe = LTXPipeline.from_pretrained("Lightricks/LTX-Video", torch_dtype=torch.bfloat16).to("cuda")
74_1_17
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
prompt = "A man walks towards a window, looks out, and then turns around. He has short, dark hair, dark skin, and is wearing a brown coat over a red and gray scarf. He walks from left to right towards a window, his gaze fixed on something outside. The camera follows him from behind at a medium distance. The room is bri...
74_1_18
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
a white curtain. As he approaches the window, he turns his head slightly to the left, then back to the right. He then turns his entire body to the right, facing the window. The camera remains stationary as he stands in front of the window. The scene is captured in real-life footage."
74_1_19
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
video = pipe( prompt=prompt, width=704, height=480, num_frames=161, num_inference_steps=50, ).frames[0] export_to_video(video, "output.mp4", fps=24) ``` <div class="flex justify-center"> <img src="https://huggingface.co/Lightricks/LTX-Video/resolve/main/media/ltx-video_example_00014.gif"/> </div> </hfoption> <hfopt...
74_1_20
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
</div> </hfoption> <hfoption id="Mochi-1"> > [!TIP] > Mochi-1 is a 10B parameter model and requires a lot of memory. Refer to the Mochi [Quantization](../api/pipelines/mochi#quantization) guide to learn how to quantize the model. CogVideoX and LTX-Video are more lightweight options that can still generate high-qual...
74_1_21
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
[Mochi-1](https://huggingface.co/genmo/mochi-1-preview) introduces the Asymmetric Diffusion Transformer (AsymmDiT) and Asymmetric Variational Autoencoder (AsymmVAE) to reduces memory requirements. AsymmVAE causally compresses videos 128x to improve memory efficiency, and AsymmDiT jointly attends to the compressed video...
74_1_22
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
```py import torch from diffusers import MochiPipeline from diffusers.utils import export_to_video
74_1_23
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
pipe = MochiPipeline.from_pretrained("genmo/mochi-1-preview", variant="bf16", torch_dtype=torch.bfloat16) # reduce memory requirements pipe.enable_model_cpu_offload() pipe.enable_vae_tiling()
74_1_24
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
prompt = "Close-up of a chameleon's eye, with its scaly skin changing color. Ultra high resolution 4k." video = pipe(prompt, num_frames=84).frames[0] export_to_video(video, "output.mp4", fps=30) ``` <div class="flex justify-center"> <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/ma...
74_1_25
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
</div> </hfoption> <hfoption id="StableVideoDiffusion"> [StableVideoDiffusion (SVD)](https://huggingface.co/stabilityai/stable-video-diffusion-img2vid-xt) is based on the Stable Diffusion 2.1 model and it is trained on images, then low-resolution videos, and finally a smaller dataset of high-resolution videos. This...
74_1_26
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
```py import torch from diffusers import StableVideoDiffusionPipeline from diffusers.utils import load_image, export_to_video
74_1_27
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
pipeline = StableVideoDiffusionPipeline.from_pretrained( "stabilityai/stable-video-diffusion-img2vid-xt", torch_dtype=torch.float16, variant="fp16" ) # reduce memory requirements pipeline.enable_model_cpu_offload() image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffu...
74_1_28
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
generator = torch.manual_seed(42) frames = pipeline(image, decode_chunk_size=8, generator=generator).frames[0] export_to_video(frames, "generated.mp4", fps=7) ``` <div class="flex gap-4"> <div> <img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/svd/roc...
74_1_29
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
<figcaption class="mt-2 text-center text-sm text-gray-500">initial image</figcaption> </div> <div> <img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/svd/output_rocket.gif"/> <figcaption class="mt-2 text-center text-sm text-gray-500">generated video</fig...
74_1_30
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
</div> </div> </hfoption> <hfoption id="AnimateDiff"> [AnimateDiff](https://huggingface.co/guoyww/animatediff) is an adapter model that inserts a motion module into a pretrained diffusion model to animate an image. The adapter is trained on video clips to learn motion which is used to condition the generation proce...
74_1_31
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
Load a `MotionAdapter` and pass it to the [`AnimateDiffPipeline`]. ```py import torch from diffusers import AnimateDiffPipeline, DDIMScheduler, MotionAdapter from diffusers.utils import export_to_gif
74_1_32
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
adapter = MotionAdapter.from_pretrained("guoyww/animatediff-motion-adapter-v1-5-2", torch_dtype=torch.float16) pipeline = AnimateDiffPipeline.from_pretrained("emilianJR/epiCRealism", motion_adapter=adapter, torch_dtype=torch.float16) scheduler = DDIMScheduler.from_pretrained( "emilianJR/epiCRealism", subfolder="schedul...
74_1_33
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
# reduce memory requirements pipeline.enable_vae_slicing() pipeline.enable_model_cpu_offload()
74_1_34
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
output = pipeline( prompt="A space rocket with trails of smoke behind it launching into space from the desert, 4k, high resolution", negative_prompt="bad quality, worse quality, low resolution", num_frames=16, guidance_scale=7.5, num_inference_steps=50, generator=torch.Generator("cpu").manual_seed(49), ) frames = outpu...
74_1_35
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#video-generation
.md
) frames = output.frames[0] export_to_gif(frames, "animation.gif") ``` <div class="flex justify-center"> <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff.gif"/> </div> </hfoption> </hfoptions>
74_1_36
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#configure-model-parameters
.md
There are a few important parameters you can configure in the pipeline that'll affect the video generation process and quality. Let's take a closer look at what these parameters do and how changing them affects the output.
74_2_0
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#number-of-frames
.md
The `num_frames` parameter determines how many video frames are generated per second. A frame is an image that is played in a sequence of other frames to create motion or a video. This affects video length because the pipeline generates a certain number of frames per second (check a pipeline's API reference for the def...
74_3_0
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#number-of-frames
.md
```py import torch from diffusers import StableVideoDiffusionPipeline from diffusers.utils import load_image, export_to_video
74_3_1
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#number-of-frames
.md
pipeline = StableVideoDiffusionPipeline.from_pretrained( "stabilityai/stable-video-diffusion-img2vid", torch_dtype=torch.float16, variant="fp16" ) pipeline.enable_model_cpu_offload() image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/svd/rocket.png") image = ima...
74_3_2
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#number-of-frames
.md
generator = torch.manual_seed(42) frames = pipeline(image, decode_chunk_size=8, generator=generator, num_frames=25).frames[0] export_to_video(frames, "generated.mp4", fps=7) ``` <div class="flex gap-4"> <div> <img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/di...
74_3_3
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#number-of-frames
.md
<figcaption class="mt-2 text-center text-sm text-gray-500">num_frames=14</figcaption> </div> <div> <img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/num_frames_25.gif"/> <figcaption class="mt-2 text-center text-sm text-gray-500">num_frames=25</figcaptio...
74_3_4
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#guidance-scale
.md
The `guidance_scale` parameter controls how closely aligned the generated video and text prompt or initial image is. A higher `guidance_scale` value means your generated video is more aligned with the text prompt or initial image, while a lower `guidance_scale` value means your generated video is less aligned which cou...
74_4_0
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#guidance-scale
.md
<Tip> SVD uses the `min_guidance_scale` and `max_guidance_scale` parameters for applying guidance to the first and last frames respectively. </Tip> ```py import torch from diffusers import I2VGenXLPipeline from diffusers.utils import export_to_gif, load_image
74_4_1
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#guidance-scale
.md
pipeline = I2VGenXLPipeline.from_pretrained("ali-vilab/i2vgen-xl", torch_dtype=torch.float16, variant="fp16") pipeline.enable_model_cpu_offload() image_url = "https://huggingface.co/datasets/diffusers/docs-images/resolve/main/i2vgen_xl_images/img_0009.png" image = load_image(image_url).convert("RGB")
74_4_2
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#guidance-scale
.md
prompt = "Papers were floating in the air on a table in the library" negative_prompt = "Distorted, discontinuous, Ugly, blurry, low resolution, motionless, static, disfigured, disconnected limbs, Ugly faces, incomplete arms" generator = torch.manual_seed(0)
74_4_3
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#guidance-scale
.md
frames = pipeline( prompt=prompt, image=image, num_inference_steps=50, negative_prompt=negative_prompt, guidance_scale=1.0, generator=generator ).frames[0] export_to_gif(frames, "i2v.gif") ``` <div class="flex gap-4"> <div> <img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/...
74_4_4
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#guidance-scale
.md
<figcaption class="mt-2 text-center text-sm text-gray-500">guidance_scale=9.0</figcaption> </div> <div> <img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guidance_scale_1.0.gif"/> <figcaption class="mt-2 text-center text-sm text-gray-500">guidance_scale...
74_4_5
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#negative-prompt
.md
A negative prompt deters the model from generating things you don’t want it to. This parameter is commonly used to improve overall generation quality by removing poor or bad features such as β€œlow resolution” or β€œbad details”. ```py import torch from diffusers import AnimateDiffPipeline, DDIMScheduler, MotionAdapter f...
74_5_0
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#negative-prompt
.md
pipeline = AnimateDiffPipeline.from_pretrained("emilianJR/epiCRealism", motion_adapter=adapter, torch_dtype=torch.float16) scheduler = DDIMScheduler.from_pretrained( "emilianJR/epiCRealism", subfolder="scheduler", clip_sample=False, timestep_spacing="linspace", beta_schedule="linear", steps_offset=1, ) pipeline.schedul...
74_5_1
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#negative-prompt
.md
output = pipeline( prompt="360 camera shot of a sushi roll in a restaurant", negative_prompt="Distorted, discontinuous, ugly, blurry, low resolution, motionless, static", num_frames=16, guidance_scale=7.5, num_inference_steps=50, generator=torch.Generator("cpu").manual_seed(0), ) frames = output.frames[0] export_to_gif...
74_5_2
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#negative-prompt
.md
) frames = output.frames[0] export_to_gif(frames, "animation.gif") ``` <div class="flex gap-4"> <div> <img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff_no_neg.gif"/> <figcaption class="mt-2 text-center text-sm text-gray-500">no negative pr...
74_5_3
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#negative-prompt
.md
<figcaption class="mt-2 text-center text-sm text-gray-500">negative prompt applied</figcaption> </div> </div>
74_5_4
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#model-specific-parameters
.md
There are some pipeline parameters that are unique to each model such as adjusting the motion in a video or adding noise to the initial image. <hfoptions id="special-parameters"> <hfoption id="Stable Video Diffusion"> Stable Video Diffusion provides additional micro-conditioning for the frame rate with the `fps` pa...
74_6_0
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#model-specific-parameters
.md
There is also a `noise_aug_strength` parameter that increases the amount of noise added to the initial image. Varying this parameter affects how similar the generated video and initial image are. A higher `noise_aug_strength` also increases the amount of motion. To learn more, read the [Micro-conditioning](../using-dif...
74_6_1
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#model-specific-parameters
.md
</hfoption> <hfoption id="Text2Video-Zero"> Text2Video-Zero computes the amount of motion to apply to each frame from randomly sampled latents. You can use the `motion_field_strength_x` and `motion_field_strength_y` parameters to control the amount of motion to apply to the x and y-axes of the video. The parameters `...
74_6_2
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#control-video-generation
.md
Video generation can be controlled similar to how text-to-image, image-to-image, and inpainting can be controlled with a [`ControlNetModel`]. The only difference is you need to use the [`~pipelines.text_to_video_synthesis.pipeline_text_to_video_zero.CrossFrameAttnProcessor`] so each frame attends to the first frame.
74_7_0
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#text2video-zero
.md
Text2Video-Zero video generation can be conditioned on pose and edge images for even greater control over a subject's motion in the generated video or to preserve the identity of a subject/object in the video. You can also use Text2Video-Zero with [InstructPix2Pix](../api/pipelines/pix2pix) for editing videos with text...
74_8_0
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#text2video-zero
.md
Start by downloading a video and extracting the pose images from it. ```py from huggingface_hub import hf_hub_download from PIL import Image import imageio
74_8_1
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#text2video-zero
.md
filename = "__assets__/poses_skeleton_gifs/dance1_corr.mp4" repo_id = "PAIR/Text2Video-Zero" video_path = hf_hub_download(repo_type="space", repo_id=repo_id, filename=filename)
74_8_2
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#text2video-zero
.md
reader = imageio.get_reader(video_path, "ffmpeg") frame_count = 8 pose_images = [Image.fromarray(reader.get_data(i)) for i in range(frame_count)] ``` Load a [`ControlNetModel`] for pose estimation and a checkpoint into the [`StableDiffusionControlNetPipeline`]. Then you'll use the [`~pipelines.text_to_video_synthesis...
74_8_3
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#text2video-zero
.md
```py import torch from diffusers import StableDiffusionControlNetPipeline, ControlNetModel from diffusers.pipelines.text_to_video_synthesis.pipeline_text_to_video_zero import CrossFrameAttnProcessor
74_8_4
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#text2video-zero
.md
model_id = "stable-diffusion-v1-5/stable-diffusion-v1-5" controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-openpose", torch_dtype=torch.float16) pipeline = StableDiffusionControlNetPipeline.from_pretrained( model_id, controlnet=controlnet, torch_dtype=torch.float16 ).to("cuda")
74_8_5
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#text2video-zero
.md
pipeline.unet.set_attn_processor(CrossFrameAttnProcessor(batch_size=2)) pipeline.controlnet.set_attn_processor(CrossFrameAttnProcessor(batch_size=2)) ``` Fix the latents for all the frames, and then pass your prompt and extracted pose images to the model to generate a video. ```py latents = torch.randn((1, 4, 64, 6...
74_8_6
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#text2video-zero
.md
prompt = "Darth Vader dancing in a desert" result = pipeline(prompt=[prompt] * len(pose_images), image=pose_images, latents=latents).images imageio.mimsave("video.mp4", result, fps=4) ``` </hfoption> <hfoption id="edge control"> Download a video and extract the edges from it. ```py from huggingface_hub import hf_...
74_8_7
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#text2video-zero
.md
filename = "__assets__/poses_skeleton_gifs/dance1_corr.mp4" repo_id = "PAIR/Text2Video-Zero" video_path = hf_hub_download(repo_type="space", repo_id=repo_id, filename=filename)
74_8_8
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#text2video-zero
.md
reader = imageio.get_reader(video_path, "ffmpeg") frame_count = 8 pose_images = [Image.fromarray(reader.get_data(i)) for i in range(frame_count)] ``` Load a [`ControlNetModel`] for canny edge and a checkpoint into the [`StableDiffusionControlNetPipeline`]. Then you'll use the [`~pipelines.text_to_video_synthesis.pipe...
74_8_9
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#text2video-zero
.md
```py import torch from diffusers import StableDiffusionControlNetPipeline, ControlNetModel from diffusers.pipelines.text_to_video_synthesis.pipeline_text_to_video_zero import CrossFrameAttnProcessor
74_8_10
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#text2video-zero
.md
model_id = "stable-diffusion-v1-5/stable-diffusion-v1-5" controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-canny", torch_dtype=torch.float16) pipeline = StableDiffusionControlNetPipeline.from_pretrained( model_id, controlnet=controlnet, torch_dtype=torch.float16 ).to("cuda")
74_8_11
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#text2video-zero
.md
pipeline.unet.set_attn_processor(CrossFrameAttnProcessor(batch_size=2)) pipeline.controlnet.set_attn_processor(CrossFrameAttnProcessor(batch_size=2)) ``` Fix the latents for all the frames, and then pass your prompt and extracted edge images to the model to generate a video. ```py latents = torch.randn((1, 4, 64, 6...
74_8_12
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#text2video-zero
.md
prompt = "Darth Vader dancing in a desert" result = pipeline(prompt=[prompt] * len(pose_images), image=pose_images, latents=latents).images imageio.mimsave("video.mp4", result, fps=4) ``` </hfoption> <hfoption id="InstructPix2Pix"> InstructPix2Pix allows you to use text to describe the changes you want to make to t...
74_8_13
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#text2video-zero
.md
filename = "__assets__/pix2pix video/camel.mp4" repo_id = "PAIR/Text2Video-Zero" video_path = hf_hub_download(repo_type="space", repo_id=repo_id, filename=filename)
74_8_14
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#text2video-zero
.md
reader = imageio.get_reader(video_path, "ffmpeg") frame_count = 8 video = [Image.fromarray(reader.get_data(i)) for i in range(frame_count)] ``` Load the [`StableDiffusionInstructPix2PixPipeline`] and set the [`~pipelines.text_to_video_synthesis.pipeline_text_to_video_zero.CrossFrameAttnProcessor`] for the UNet. ```...
74_8_15
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#text2video-zero
.md
pipeline = StableDiffusionInstructPix2PixPipeline.from_pretrained("timbrooks/instruct-pix2pix", torch_dtype=torch.float16).to("cuda") pipeline.unet.set_attn_processor(CrossFrameAttnProcessor(batch_size=3)) ``` Pass a prompt describing the change you want to apply to the video. ```py prompt = "make it Van Gogh Starr...
74_8_16
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#optimize
.md
Video generation requires a lot of memory because you're generating many video frames at once. You can reduce your memory requirements at the expense of some inference speed. Try: 1. offloading pipeline components that are no longer needed to the CPU 2. feed-forward chunking runs the feed-forward layer in a loop inst...
74_9_0
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#optimize
.md
```diff - pipeline.enable_model_cpu_offload() - frames = pipeline(image, decode_chunk_size=8, generator=generator).frames[0] + pipeline.enable_model_cpu_offload() + pipeline.unet.enable_forward_chunking() + frames = pipeline(image, decode_chunk_size=2, generator=generator, num_frames=25).frames[0] ``` If memory is no...
74_9_1
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#optimize
.md
```diff - pipeline.enable_model_cpu_offload() + pipeline.to("cuda") + pipeline.unet = torch.compile(pipeline.unet, mode="reduce-overhead", fullgraph=True) ```
74_9_2
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/text-img2vid.md
https://huggingface.co/docs/diffusers/en/using-diffusers/text-img2vid/#quantization
.md
Quantization helps reduce the memory requirements of very large models by storing model weights in a lower precision data type. However, quantization may have varying impact on video quality depending on the video model. Refer to the [Quantization](../../quantization/overview) to learn more about supported quantizati...
74_10_0
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/t2i_adapter.md
https://huggingface.co/docs/diffusers/en/using-diffusers/t2i_adapter/
.md
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agr...
75_0_0
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/t2i_adapter.md
https://huggingface.co/docs/diffusers/en/using-diffusers/t2i_adapter/
.md
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->
75_0_1
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/t2i_adapter.md
https://huggingface.co/docs/diffusers/en/using-diffusers/t2i_adapter/#t2i-adapter
.md
[T2I-Adapter](https://hf.co/papers/2302.08453) is a lightweight adapter for controlling and providing more accurate structure guidance for text-to-image models. It works by learning an alignment between the internal knowledge of the text-to-image model and an external control signal, such as edge detection or depth est...
75_1_0
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/t2i_adapter.md
https://huggingface.co/docs/diffusers/en/using-diffusers/t2i_adapter/#t2i-adapter
.md
The T2I-Adapter design is simple, the condition is passed to four feature extraction blocks and three downsample blocks. This makes it fast and easy to train different adapters for different conditions which can be plugged into the text-to-image model. T2I-Adapter is similar to [ControlNet](controlnet) except it is sma...
75_1_1
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/t2i_adapter.md
https://huggingface.co/docs/diffusers/en/using-diffusers/t2i_adapter/#t2i-adapter
.md
than ControlNet. This guide will show you how to use T2I-Adapter with different Stable Diffusion models and how you can compose multiple T2I-Adapters to impose more than one condition. > [!TIP] > There are several T2I-Adapters available for different conditions, such as color palette, depth, sketch, pose, and > seg...
75_1_2
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/t2i_adapter.md
https://huggingface.co/docs/diffusers/en/using-diffusers/t2i_adapter/#t2i-adapter
.md
Before you begin, make sure you have the following libraries installed. ```py # uncomment to install the necessary libraries in Colab #!pip install -q diffusers accelerate controlnet-aux==0.0.7 ```
75_1_3
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/t2i_adapter.md
https://huggingface.co/docs/diffusers/en/using-diffusers/t2i_adapter/#text-to-image
.md
Text-to-image models rely on a prompt to generate an image, but sometimes, text alone may not be enough to provide more accurate structural guidance. T2I-Adapter allows you to provide an additional control image to guide the generation process. For example, you can provide a canny image (a white outline of an image on ...
75_2_0
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/t2i_adapter.md
https://huggingface.co/docs/diffusers/en/using-diffusers/t2i_adapter/#text-to-image
.md
model to generate an image with a similar structure. <hfoptions id="stablediffusion"> <hfoption id="Stable Diffusion 1.5"> Create a canny image with the [opencv-library](https://github.com/opencv/opencv-python). ```py import cv2 import numpy as np from PIL import Image from diffusers.utils import load_image
75_2_1