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/api/pipelines/i2vgenxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/i2vgenxl/#notes | .md | * When using the [`DDIMScheduler`] (which is default for this pipeline), less than 50 steps for inference leads to bad results.
* This implementation is 1-stage variant of I2VGenXL. The main figure in the [I2VGen-XL](https://arxiv.org/abs/2311.04145) paper shows a 2-stage variant, however, 1-stage variant works well. S... | 117_2_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/i2vgenxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/i2vgenxl/#i2vgenxlpipeline | .md | I2VGenXLPipeline
Pipeline for image-to-video generation as proposed in [I2VGenXL](https://i2vgen-xl.github.io/).
This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).
Arg... | 117_3_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/i2vgenxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/i2vgenxl/#i2vgenxlpipeline | .md | text_encoder ([`CLIPTextModel`]):
Frozen text-encoder ([clip-vit-large-patch14](https://huggingface.co/openai/clip-vit-large-patch14)).
tokenizer (`CLIPTokenizer`):
A [`~transformers.CLIPTokenizer`] to tokenize text.
unet ([`I2VGenXLUNet`]):
A [`I2VGenXLUNet`] to denoise the encoded video latents.
scheduler ([`DDIMSche... | 117_3_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/i2vgenxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/i2vgenxl/#i2vgenxlpipelineoutput | .md | I2VGenXLPipelineOutput
Output class for image-to-video pipeline.
Args:
frames (`torch.Tensor`, `np.ndarray`, or List[List[PIL.Image.Image]]):
List of video outputs - It can be a nested list of length `batch_size,` with each sub-list containing
denoised
PIL image sequences of length `num_frames.` It can also be a Nu... | 117_4_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/ | .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... | 118_0_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/ | .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.
--> | 118_0_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#instructpix2pix | .md | [InstructPix2Pix: Learning to Follow Image Editing Instructions](https://huggingface.co/papers/2211.09800) is by Tim Brooks, Aleksander Holynski and Alexei A. Efros.
The abstract from the paper is: | 118_1_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#instructpix2pix | .md | *We propose a method for editing images from human instructions: given an input image and a written instruction that tells the model what to do, our model follows these instructions to edit the image. To obtain training data for this problem, we combine the knowledge of two large pretrained models -- a language model (... | 118_1_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#instructpix2pix | .md | a large dataset of image editing examples. Our conditional diffusion model, InstructPix2Pix, is trained on our generated data, and generalizes to real images and user-written instructions at inference time. Since it performs edits in the forward pass and does not require per example fine-tuning or inversion, our model ... | 118_1_2 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#instructpix2pix | .md | You can find additional information about InstructPix2Pix on the [project page](https://www.timothybrooks.com/instruct-pix2pix), [original codebase](https://github.com/timothybrooks/instruct-pix2pix), and try it out in a [demo](https://huggingface.co/spaces/timbrooks/instruct-pix2pix).
<Tip> | 118_1_3 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#instructpix2pix | .md | <Tip>
Make sure to check out the Schedulers [guide](../../using-diffusers/schedulers) to learn how to explore the tradeoff between scheduler speed and quality, and see the [reuse components across pipelines](../../using-diffusers/loading#reuse-a-pipeline) section to learn how to efficiently load the same components i... | 118_1_4 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#stablediffusioninstructpix2pixpipeline | .md | StableDiffusionInstructPix2PixPipeline
Pipeline for pixel-level image editing by following text instructions (based on Stable Diffusion).
This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a partic... | 118_2_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#stablediffusioninstructpix2pixpipeline | .md | - [`~loaders.TextualInversionLoaderMixin.load_textual_inversion`] for loading textual inversion embeddings
- [`~loaders.StableDiffusionLoraLoaderMixin.load_lora_weights`] for loading LoRA weights
- [`~loaders.StableDiffusionLoraLoaderMixin.save_lora_weights`] for saving LoRA weights
- [`~loaders.IPAdapterMixin.load_ip_... | 118_2_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#stablediffusioninstructpix2pixpipeline | .md | vae ([`AutoencoderKL`]):
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.
text_encoder ([`~transformers.CLIPTextModel`]):
Frozen text-encoder ([clip-vit-large-patch14](https://huggingface.co/openai/clip-vit-large-patch14)).
tokenizer ([`~transformers.CLIPTokenizer`]):... | 118_2_2 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#stablediffusioninstructpix2pixpipeline | .md | unet ([`UNet2DConditionModel`]):
A `UNet2DConditionModel` to denoise the encoded image latents.
scheduler ([`SchedulerMixin`]):
A scheduler to be used in combination with `unet` to denoise the encoded image latents. Can be one of
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
safety_checker ([`Stabl... | 118_2_3 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#stablediffusioninstructpix2pixpipeline | .md | Classification module that estimates whether generated images could be considered offensive or harmful.
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
more details about a model's potential harms.
feature_extractor ([`~transformers.CLIPImageProcessor`]):
A `CLIP... | 118_2_4 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#stablediffusionxlinstructpix2pixpipeline | .md | StableDiffusionXLInstructPix2PixPipeline
Pipeline for pixel-level image editing by following text instructions. Based on Stable Diffusion XL.
This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading o... | 118_3_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#stablediffusionxlinstructpix2pixpipeline | .md | The pipeline also inherits the following loading methods:
- [`~loaders.TextualInversionLoaderMixin.load_textual_inversion`] for loading textual inversion embeddings
- [`~loaders.FromSingleFileMixin.from_single_file`] for loading `.ckpt` files
- [`~loaders.StableDiffusionXLLoraLoaderMixin.load_lora_weights`] for loading... | 118_3_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#stablediffusionxlinstructpix2pixpipeline | .md | - [`~loaders.StableDiffusionXLLoraLoaderMixin.save_lora_weights`] for saving LoRA weights
Args:
vae ([`AutoencoderKL`]):
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.
text_encoder ([`CLIPTextModel`]):
Frozen text-encoder. Stable Diffusion XL uses the text portion... | 118_3_2 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#stablediffusionxlinstructpix2pixpipeline | .md | [CLIP](https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel), specifically
the [clip-vit-large-patch14](https://huggingface.co/openai/clip-vit-large-patch14) variant.
text_encoder_2 ([` CLIPTextModelWithProjection`]):
Second frozen text-encoder. Stable Diffusion XL uses the text and pool p... | 118_3_3 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#stablediffusionxlinstructpix2pixpipeline | .md | [CLIP](https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModelWithProjection),
specifically the
[laion/CLIP-ViT-bigG-14-laion2B-39B-b160k](https://huggingface.co/laion/CLIP-ViT-bigG-14-laion2B-39B-b160k)
variant.
tokenizer (`CLIPTokenizer`):
Tokenizer of class
[CLIPTokenizer](https://huggingf... | 118_3_4 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#stablediffusionxlinstructpix2pixpipeline | .md | tokenizer_2 (`CLIPTokenizer`):
Second Tokenizer of class
[CLIPTokenizer](https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer).
unet ([`UNet2DConditionModel`]): Conditional U-Net architecture to denoise the encoded image latents.
scheduler ([`SchedulerMixin`]):
A scheduler to be... | 118_3_5 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#stablediffusionxlinstructpix2pixpipeline | .md | [`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
requires_aesthetics_score (`bool`, *optional*, defaults to `"False"`):
Whether the `unet` requires a aesthetic_score condition to be passed during inference. Also see the config
of `stabilityai/stable-diffusion-xl-refiner-1-0`.
force_zeros_for_empty_pro... | 118_3_6 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#stablediffusionxlinstructpix2pixpipeline | .md | Whether the negative prompt embeddings shall be forced to always be set to 0. Also see the config of
`stabilityai/stable-diffusion-xl-base-1-0`.
add_watermarker (`bool`, *optional*):
Whether to use the [invisible_watermark library](https://github.com/ShieldMnt/invisible-watermark/) to
watermark output images. If not de... | 118_3_7 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/pix2pix.md | https://huggingface.co/docs/diffusers/en/api/pipelines/pix2pix/#stablediffusionxlinstructpix2pixpipeline | .md | watermarker will be used.
is_cosxl_edit (`bool`, *optional*):
When set the image latents are scaled.
- __call__
- all | 118_3_8 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/ | .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... | 119_0_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/ | .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.
--> | 119_0_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#controlnet-with-stable-diffusion-xl | .md | ControlNet was introduced in [Adding Conditional Control to Text-to-Image Diffusion Models](https://huggingface.co/papers/2302.05543) by Lvmin Zhang, Anyi Rao, and Maneesh Agrawala. | 119_1_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#controlnet-with-stable-diffusion-xl | .md | With a ControlNet model, you can provide an additional control image to condition and control Stable Diffusion generation. For example, if you provide a depth map, the ControlNet model generates an image that'll preserve the spatial information from the depth map. It is a more flexible and accurate way to control the i... | 119_1_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#controlnet-with-stable-diffusion-xl | .md | *We present ControlNet, a neural network architecture to add spatial conditioning controls to large, pretrained text-to-image diffusion models. ControlNet locks the production-ready large diffusion models, and reuses their deep and robust encoding layers pretrained with billions of images as a strong backbone to learn ... | 119_1_2 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#controlnet-with-stable-diffusion-xl | .md | connected with "zero convolutions" (zero-initialized convolution layers) that progressively grow the parameters from zero and ensure that no harmful noise could affect the finetuning. We test various conditioning controls, eg, edges, depth, segmentation, human pose, etc, with Stable Diffusion, using single or multiple ... | 119_1_3 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#controlnet-with-stable-diffusion-xl | .md | ControlNets is robust with small (<50k) and large (>1m) datasets. Extensive results show that ControlNet may facilitate wider applications to control image diffusion models.* | 119_1_4 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#controlnet-with-stable-diffusion-xl | .md | You can find additional smaller Stable Diffusion XL (SDXL) ControlNet checkpoints from the 🤗 [Diffusers](https://huggingface.co/diffusers) Hub organization, and browse [community-trained](https://huggingface.co/models?other=stable-diffusion-xl&other=controlnet) checkpoints on the Hub.
<Tip warning={true}> | 119_1_5 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#controlnet-with-stable-diffusion-xl | .md | <Tip warning={true}>
🧪 Many of the SDXL ControlNet checkpoints are experimental, and there is a lot of room for improvement. Feel free to open an [Issue](https://github.com/huggingface/diffusers/issues/new/choose) and leave us feedback on how we can improve!
</Tip>
If you don't see a checkpoint you're interested... | 119_1_6 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#controlnet-with-stable-diffusion-xl | .md | <Tip>
Make sure to check out the Schedulers [guide](../../using-diffusers/schedulers) to learn how to explore the tradeoff between scheduler speed and quality, and see the [reuse components across pipelines](../../using-diffusers/loading#reuse-a-pipeline) section to learn how to efficiently load the same components i... | 119_1_7 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetpipeline | .md | StableDiffusionXLControlNetPipeline
Pipeline for text-to-image generation using Stable Diffusion XL with ControlNet guidance.
This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device,... | 119_2_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetpipeline | .md | - [`~loaders.TextualInversionLoaderMixin.load_textual_inversion`] for loading textual inversion embeddings
- [`~loaders.StableDiffusionXLLoraLoaderMixin.load_lora_weights`] for loading LoRA weights
- [`~loaders.StableDiffusionXLLoraLoaderMixin.save_lora_weights`] for saving LoRA weights
- [`~loaders.FromSingleFileMixin... | 119_2_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetpipeline | .md | - [`~loaders.IPAdapterMixin.load_ip_adapter`] for loading IP Adapters
Args:
vae ([`AutoencoderKL`]):
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.
text_encoder ([`~transformers.CLIPTextModel`]):
Frozen text-encoder ([clip-vit-large-patch14](https://huggingface.co... | 119_2_2 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetpipeline | .md | text_encoder_2 ([`~transformers.CLIPTextModelWithProjection`]):
Second frozen text-encoder
([laion/CLIP-ViT-bigG-14-laion2B-39B-b160k](https://huggingface.co/laion/CLIP-ViT-bigG-14-laion2B-39B-b160k)).
tokenizer ([`~transformers.CLIPTokenizer`]):
A `CLIPTokenizer` to tokenize text.
tokenizer_2 ([`~transformers.CLIPToke... | 119_2_3 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetpipeline | .md | unet ([`UNet2DConditionModel`]):
A `UNet2DConditionModel` to denoise the encoded image latents.
controlnet ([`ControlNetModel`] or `List[ControlNetModel]`):
Provides additional conditioning to the `unet` during the denoising process. If you set multiple
ControlNets as a list, the outputs from each ControlNet are added ... | 119_2_4 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetpipeline | .md | A scheduler to be used in combination with `unet` to denoise the encoded image latents. Can be one of
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
force_zeros_for_empty_prompt (`bool`, *optional*, defaults to `"True"`):
Whether the negative prompt embeddings should always be set to 0. Also see the... | 119_2_5 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetpipeline | .md | `stabilityai/stable-diffusion-xl-base-1-0`.
add_watermarker (`bool`, *optional*):
Whether to use the [invisible_watermark](https://github.com/ShieldMnt/invisible-watermark/) library to
watermark output images. If not defined, it defaults to `True` if the package is installed; otherwise no
watermarker is used.
- all
-... | 119_2_6 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetimg2imgpipeline | .md | StableDiffusionXLControlNetImg2ImgPipeline
Pipeline for image-to-image generation using Stable Diffusion XL with ControlNet guidance.
This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving... | 119_3_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetimg2imgpipeline | .md | The pipeline also inherits the following loading methods:
- [`~loaders.TextualInversionLoaderMixin.load_textual_inversion`] for loading textual inversion embeddings
- [`~loaders.StableDiffusionXLLoraLoaderMixin.load_lora_weights`] for loading LoRA weights
- [`~loaders.StableDiffusionXLLoraLoaderMixin.save_lora_weights`... | 119_3_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetimg2imgpipeline | .md | - [`~loaders.IPAdapterMixin.load_ip_adapter`] for loading IP Adapters
Args:
vae ([`AutoencoderKL`]):
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.
text_encoder ([`CLIPTextModel`]):
Frozen text-encoder. Stable Diffusion uses the text portion of
[CLIP](https://hugg... | 119_3_2 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetimg2imgpipeline | .md | the [clip-vit-large-patch14](https://huggingface.co/openai/clip-vit-large-patch14) variant.
text_encoder_2 ([` CLIPTextModelWithProjection`]):
Second frozen text-encoder. Stable Diffusion XL uses the text and pool portion of
[CLIP](https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModelWithPr... | 119_3_3 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetimg2imgpipeline | .md | variant.
tokenizer (`CLIPTokenizer`):
Tokenizer of class
[CLIPTokenizer](https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer).
tokenizer_2 (`CLIPTokenizer`):
Second Tokenizer of class
[CLIPTokenizer](https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformer... | 119_3_4 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetimg2imgpipeline | .md | controlnet ([`ControlNetModel`] or `List[ControlNetModel]`):
Provides additional conditioning to the unet during the denoising process. If you set multiple ControlNets
as a list, the outputs from each ControlNet are added together to create one combined additional
conditioning.
scheduler ([`SchedulerMixin`]):
A schedul... | 119_3_5 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetimg2imgpipeline | .md | [`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
requires_aesthetics_score (`bool`, *optional*, defaults to `"False"`):
Whether the `unet` requires an `aesthetic_score` condition to be passed during inference. Also see the
config of `stabilityai/stable-diffusion-xl-refiner-1-0`.
force_zeros_for_empty_... | 119_3_6 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetimg2imgpipeline | .md | Whether the negative prompt embeddings shall be forced to always be set to 0. Also see the config of
`stabilityai/stable-diffusion-xl-base-1-0`.
add_watermarker (`bool`, *optional*):
Whether to use the [invisible_watermark library](https://github.com/ShieldMnt/invisible-watermark/) to
watermark output images. If not de... | 119_3_7 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetimg2imgpipeline | .md | watermarker will be used.
feature_extractor ([`~transformers.CLIPImageProcessor`]):
A `CLIPImageProcessor` to extract features from generated images; used as inputs to the `safety_checker`.
- all
- __call__ | 119_3_8 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetinpaintpipeline | .md | StableDiffusionXLControlNetInpaintPipeline
Pipeline for text-to-image generation using Stable Diffusion XL.
This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular ... | 119_4_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetinpaintpipeline | .md | - [`~loaders.TextualInversionLoaderMixin.load_textual_inversion`] for loading textual inversion embeddings
- [`~loaders.StableDiffusionXLLoraLoaderMixin.load_lora_weights`] for loading LoRA weights
- [`~loaders.StableDiffusionXLLoraLoaderMixin.save_lora_weights`] for saving LoRA weights
- [`~loaders.FromSingleFileMixin... | 119_4_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetinpaintpipeline | .md | - [`~loaders.IPAdapterMixin.load_ip_adapter`] for loading IP Adapters
Args:
vae ([`AutoencoderKL`]):
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.
text_encoder ([`CLIPTextModel`]):
Frozen text-encoder. Stable Diffusion XL uses the text portion of
[CLIP](https://h... | 119_4_2 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetinpaintpipeline | .md | the [clip-vit-large-patch14](https://huggingface.co/openai/clip-vit-large-patch14) variant.
text_encoder_2 ([` CLIPTextModelWithProjection`]):
Second frozen text-encoder. Stable Diffusion XL uses the text and pool portion of
[CLIP](https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModelWithPr... | 119_4_3 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetinpaintpipeline | .md | variant.
tokenizer (`CLIPTokenizer`):
Tokenizer of class
[CLIPTokenizer](https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer).
tokenizer_2 (`CLIPTokenizer`):
Second Tokenizer of class
[CLIPTokenizer](https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformer... | 119_4_4 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionxlcontrolnetinpaintpipeline | .md | scheduler ([`SchedulerMixin`]):
A scheduler to be used in combination with `unet` to denoise the encoded image latents. Can be one of
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
- all
- __call__ | 119_4_5 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/controlnet_sdxl.md | https://huggingface.co/docs/diffusers/en/api/pipelines/controlnet_sdxl/#stablediffusionpipelineoutput | .md | StableDiffusionPipelineOutput
Output class for Stable Diffusion pipelines.
Args:
images (`List[PIL.Image.Image]` or `np.ndarray`)
List of denoised PIL images of length `batch_size` or NumPy array of shape `(batch_size, height, width,
num_channels)`.
nsfw_content_detected (`List[bool]`)
List indicating whether the c... | 119_5_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/ | .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... | 120_0_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/ | .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.
--> | 120_0_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#flux | .md | Flux is a series of text-to-image generation models based on diffusion transformers. To know more about Flux, check out the original [blog post](https://blackforestlabs.ai/announcing-black-forest-labs/) by the creators of Flux, Black Forest Labs.
Original model checkpoints for Flux can be found [here](https://hugging... | 120_1_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#flux | .md | Flux can be quite expensive to run on consumer hardware devices. However, you can perform a suite of optimizations to run it faster and in a more memory-friendly manner. Check out [this section](https://huggingface.co/blog/sd3#memory-optimizations-for-sd3) for more details. Additionally, Flux can benefit from quantizat... | 120_1_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#flux | .md | Refer to [this blog post](https://huggingface.co/blog/quanto-diffusers) to learn more. For an exhaustive list of resources, check out [this gist](https://gist.github.com/sayakpaul/b664605caf0aa3bf8585ab109dd5ac9c). | 120_1_2 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#flux | .md | </Tip>
Flux comes in the following variants:
| model type | model id |
|:----------:|:--------:|
| Timestep-distilled | [`black-forest-labs/FLUX.1-schnell`](https://huggingface.co/black-forest-labs/FLUX.1-schnell) |
| Guidance-distilled | [`black-forest-labs/FLUX.1-dev`](https://huggingface.co/black-forest-labs/FLU... | 120_1_3 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#flux | .md | | Canny Control (Guidance-distilled) | [`black-forest-labs/FLUX.1-Canny-dev`](https://huggingface.co/black-forest-labs/FLUX.1-Canny-dev) |
| Depth Control (Guidance-distilled) | [`black-forest-labs/FLUX.1-Depth-dev`](https://huggingface.co/black-forest-labs/FLUX.1-Depth-dev) |
| Canny Control (LoRA) | [`black-forest-la... | 120_1_4 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#flux | .md | | Depth Control (LoRA) | [`black-forest-labs/FLUX.1-Depth-dev-lora`](https://huggingface.co/black-forest-labs/FLUX.1-Depth-dev-lora) |
| Redux (Adapter) | [`black-forest-labs/FLUX.1-Redux-dev`](https://huggingface.co/black-forest-labs/FLUX.1-Redux-dev) |
All checkpoints have different usage which we detail below. | 120_1_5 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#timestep-distilled | .md | * `max_sequence_length` cannot be more than 256.
* `guidance_scale` needs to be 0.
* As this is a timestep-distilled model, it benefits from fewer sampling steps.
```python
import torch
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat... | 120_2_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#timestep-distilled | .md | prompt = "A cat holding a sign that says hello world"
out = pipe(
prompt=prompt,
guidance_scale=0.,
height=768,
width=1360,
num_inference_steps=4,
max_sequence_length=256,
).images[0]
out.save("image.png")
``` | 120_2_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#guidance-distilled | .md | * The guidance-distilled variant takes about 50 sampling steps for good-quality generation.
* It doesn't have any limitations around the `max_sequence_length`.
```python
import torch
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
pip... | 120_3_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#guidance-distilled | .md | prompt = "a tiny astronaut hatching from an egg on the moon"
out = pipe(
prompt=prompt,
guidance_scale=3.5,
height=768,
width=1360,
num_inference_steps=50,
).images[0]
out.save("image.png")
``` | 120_3_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#fill-inpaintingoutpainting | .md | * Flux Fill pipeline does not require `strength` as an input like regular inpainting pipelines.
* It supports both inpainting and outpainting.
```python
import torch
from diffusers import FluxFillPipeline
from diffusers.utils import load_image
image = load_image("https://huggingface.co/datasets/YiYiXu/testing-images... | 120_4_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#fill-inpaintingoutpainting | .md | repo_id = "black-forest-labs/FLUX.1-Fill-dev"
pipe = FluxFillPipeline.from_pretrained(repo_id, torch_dtype=torch.bfloat16).to("cuda")
image = pipe(
prompt="a white paper cup",
image=image,
mask_image=mask,
height=1632,
width=1232,
max_sequence_length=512,
generator=torch.Generator("cpu").manual_seed(0)
).images[0]
ima... | 120_4_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#canny-control | .md | **Note:** `black-forest-labs/Flux.1-Canny-dev` is _not_ a [`ControlNetModel`] model. ControlNet models are a separate component from the UNet/Transformer whose residuals are added to the actual underlying model. Canny Control is an alternate architecture that achieves effectively the same results as a ControlNet model ... | 120_5_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#canny-control | .md | ```python
# !pip install -U controlnet-aux
import torch
from controlnet_aux import CannyDetector
from diffusers import FluxControlPipeline
from diffusers.utils import load_image | 120_5_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#canny-control | .md | pipe = FluxControlPipeline.from_pretrained("black-forest-labs/FLUX.1-Canny-dev", torch_dtype=torch.bfloat16).to("cuda")
prompt = "A robot made of exotic candies and chocolates of different kinds. The background is filled with confetti and celebratory gifts."
control_image = load_image("https://huggingface.co/datasets/... | 120_5_2 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#canny-control | .md | processor = CannyDetector()
control_image = processor(control_image, low_threshold=50, high_threshold=200, detect_resolution=1024, image_resolution=1024) | 120_5_3 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#canny-control | .md | image = pipe(
prompt=prompt,
control_image=control_image,
height=1024,
width=1024,
num_inference_steps=50,
guidance_scale=30.0,
).images[0]
image.save("output.png")
```
Canny Control is also possible with a LoRA variant of this condition. The usage is as follows:
```python
# !pip install -U controlnet-aux
import to... | 120_5_4 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#canny-control | .md | pipe = FluxControlPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16).to("cuda")
pipe.load_lora_weights("black-forest-labs/FLUX.1-Canny-dev-lora")
prompt = "A robot made of exotic candies and chocolates of different kinds. The background is filled with confetti and celebratory gifts."
... | 120_5_5 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#canny-control | .md | processor = CannyDetector()
control_image = processor(control_image, low_threshold=50, high_threshold=200, detect_resolution=1024, image_resolution=1024)
image = pipe(
prompt=prompt,
control_image=control_image,
height=1024,
width=1024,
num_inference_steps=50,
guidance_scale=30.0,
).images[0]
image.save("output.png")
... | 120_5_6 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#depth-control | .md | **Note:** `black-forest-labs/Flux.1-Depth-dev` is _not_ a ControlNet model. [`ControlNetModel`] models are a separate component from the UNet/Transformer whose residuals are added to the actual underlying model. Depth Control is an alternate architecture that achieves effectively the same results as a ControlNet model ... | 120_6_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#depth-control | .md | ```python
# !pip install git+https://github.com/huggingface/image_gen_aux
import torch
from diffusers import FluxControlPipeline, FluxTransformer2DModel
from diffusers.utils import load_image
from image_gen_aux import DepthPreprocessor | 120_6_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#depth-control | .md | pipe = FluxControlPipeline.from_pretrained("black-forest-labs/FLUX.1-Depth-dev", torch_dtype=torch.bfloat16).to("cuda")
prompt = "A robot made of exotic candies and chocolates of different kinds. The background is filled with confetti and celebratory gifts."
control_image = load_image("https://huggingface.co/datasets/... | 120_6_2 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#depth-control | .md | processor = DepthPreprocessor.from_pretrained("LiheYoung/depth-anything-large-hf")
control_image = processor(control_image)[0].convert("RGB") | 120_6_3 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#depth-control | .md | image = pipe(
prompt=prompt,
control_image=control_image,
height=1024,
width=1024,
num_inference_steps=30,
guidance_scale=10.0,
generator=torch.Generator().manual_seed(42),
).images[0]
image.save("output.png")
```
Depth Control is also possible with a LoRA variant of this condition. The usage is as follows:
```pyth... | 120_6_4 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#depth-control | .md | import torch
from diffusers import FluxControlPipeline, FluxTransformer2DModel
from diffusers.utils import load_image
from image_gen_aux import DepthPreprocessor | 120_6_5 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#depth-control | .md | pipe = FluxControlPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16).to("cuda")
pipe.load_lora_weights("black-forest-labs/FLUX.1-Depth-dev-lora")
prompt = "A robot made of exotic candies and chocolates of different kinds. The background is filled with confetti and celebratory gifts."
... | 120_6_6 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#depth-control | .md | processor = DepthPreprocessor.from_pretrained("LiheYoung/depth-anything-large-hf")
control_image = processor(control_image)[0].convert("RGB")
image = pipe(
prompt=prompt,
control_image=control_image,
height=1024,
width=1024,
num_inference_steps=30,
guidance_scale=10.0,
generator=torch.Generator().manual_seed(42),
).im... | 120_6_7 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#redux | .md | * Flux Redux pipeline is an adapter for FLUX.1 base models. It can be used with both flux-dev and flux-schnell, for image-to-image generation.
* You can first use the `FluxPriorReduxPipeline` to get the `prompt_embeds` and `pooled_prompt_embeds`, and then feed them into the `FluxPipeline` for image-to-image generation.... | 120_7_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#redux | .md | ```python
import torch
from diffusers import FluxPriorReduxPipeline, FluxPipeline
from diffusers.utils import load_image
device = "cuda"
dtype = torch.bfloat16 | 120_7_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#redux | .md | repo_redux = "black-forest-labs/FLUX.1-Redux-dev"
repo_base = "black-forest-labs/FLUX.1-dev"
pipe_prior_redux = FluxPriorReduxPipeline.from_pretrained(repo_redux, torch_dtype=dtype).to(device)
pipe = FluxPipeline.from_pretrained(
repo_base,
text_encoder=None,
text_encoder_2=None,
torch_dtype=torch.bfloat16
).to(device) | 120_7_2 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#redux | .md | image = load_image("https://huggingface.co/datasets/YiYiXu/testing-images/resolve/main/style_ziggy/img5.png")
pipe_prior_output = pipe_prior_redux(image)
images = pipe(
guidance_scale=2.5,
num_inference_steps=50,
generator=torch.Generator("cpu").manual_seed(0),
**pipe_prior_output,
).images
images[0].save("flux-redux.p... | 120_7_3 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#combining-flux-turbo-loras-with-flux-control-fill-and-redux | .md | We can combine Flux Turbo LoRAs with Flux Control and other pipelines like Fill and Redux to enable few-steps' inference. The example below shows how to do that for Flux Control LoRA for depth and turbo LoRA from [`ByteDance/Hyper-SD`](https://hf.co/ByteDance/Hyper-SD).
```py
from diffusers import FluxControlPipeline... | 120_8_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#combining-flux-turbo-loras-with-flux-control-fill-and-redux | .md | control_pipe = FluxControlPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
control_pipe.load_lora_weights("black-forest-labs/FLUX.1-Depth-dev-lora", adapter_name="depth")
control_pipe.load_lora_weights(
hf_hub_download("ByteDance/Hyper-SD", "Hyper-FLUX.1-dev-8steps-lora.safetensors")... | 120_8_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#combining-flux-turbo-loras-with-flux-control-fill-and-redux | .md | prompt = "A robot made of exotic candies and chocolates of different kinds. The background is filled with confetti and celebratory gifts."
control_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/robot.png")
processor = DepthPreprocessor.from_pretrained("LiheYoung/depth... | 120_8_2 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#combining-flux-turbo-loras-with-flux-control-fill-and-redux | .md | image = control_pipe(
prompt=prompt,
control_image=control_image,
height=1024,
width=1024,
num_inference_steps=8,
guidance_scale=10.0,
generator=torch.Generator().manual_seed(42),
).images[0]
image.save("output.png")
``` | 120_8_3 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#note-about-unloadloraweights-when-using-flux-loras | .md | When unloading the Control LoRA weights, call `pipe.unload_lora_weights(reset_to_overwritten_params=True)` to reset the `pipe.transformer` completely back to its original form. The resultant pipeline can then be used with methods like [`DiffusionPipeline.from_pipe`]. More details about this argument are available in [t... | 120_9_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#running-fp16-inference | .md | Flux can generate high-quality images with FP16 (i.e. to accelerate inference on Turing/Volta GPUs) but produces different outputs compared to FP32/BF16. The issue is that some activations in the text encoders have to be clipped when running in FP16, which affects the overall image. Forcing text encoders to run with FP... | 120_10_0 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#running-fp16-inference | .md | FP16 inference code:
```python
import torch
from diffusers import FluxPipeline | 120_10_1 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#running-fp16-inference | .md | pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16) # can replace schnell with dev
# to run on low vram GPUs (i.e. between 4 and 32 GB VRAM)
pipe.enable_sequential_cpu_offload()
pipe.vae.enable_slicing()
pipe.vae.enable_tiling()
pipe.to(torch.float16) # casting here inst... | 120_10_2 |
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/api/pipelines/flux.md | https://huggingface.co/docs/diffusers/en/api/pipelines/flux/#running-fp16-inference | .md | prompt = "A cat holding a sign that says hello world"
out = pipe(
prompt=prompt,
guidance_scale=0.,
height=768,
width=1360,
num_inference_steps=4,
max_sequence_length=256,
).images[0]
out.save("image.png")
``` | 120_10_3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.