| < |
| |
| you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
|
|
| http: |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| b) VD initiates novel extensions and applications such as disentanglement of style and semantic, image-text dual-guided generation, etc.; c) Through these experiments and applications, VD provides more semantic insights of the generated outputs.* |
|
|
| ## Tips |
|
|
| - VersatileDiffusion is conceptually very similar as [Stable Diffusion](./api/pipelines/stable_diffusion/overview), but instead of providing just a image data stream conditioned on text, VersatileDiffusion provides both a image and text data stream and can be conditioned on both text and image. |
|
|
| ### *Run VersatileDiffusion* |
|
|
| You can both load the memory intensive "all-in-one" [`VersatileDiffusionPipeline`] that can run all tasks |
| with the same class as shown in [`VersatileDiffusionPipeline.text_to_image`], [`VersatileDiffusionPipeline.image_variation`], and [`VersatileDiffusionPipeline.dual_guided`] |
|
|
| **or** |
|
|
| You can run the individual pipelines which are much more memory efficient: |
|
|
| - *Text-to-Image*: [`VersatileDiffusionTextToImagePipeline.__call__`] |
| - *Image Variation*: [`VersatileDiffusionImageVariationPipeline.__call__`] |
| - *Dual Text and Image Guided Generation*: [`VersatileDiffusionDualGuidedPipeline.__call__`] |
|
|
| ### *How to load and use different schedulers.* |
|
|
| The versatile diffusion pipelines uses [`DDIMScheduler`] scheduler by default. But `diffusers` provides many other schedulers that can be used with the alt diffusion pipeline such as [`PNDMScheduler`], [`LMSDiscreteScheduler`], [`EulerDiscreteScheduler`], [`EulerAncestralDiscreteScheduler`] etc. |
| To use a different scheduler, you can either change it via the [`ConfigMixin.from_config`] method or pass the `scheduler` argument to the `from_pretrained` method of the pipeline. For example, to use the [`EulerDiscreteScheduler`], you can do the following: |
|
|
| ```python |
| >>> from diffusers import VersatileDiffusionPipeline, EulerDiscreteScheduler |
|
|
| >>> pipeline = VersatileDiffusionPipeline.from_pretrained("shi-labs/versatile-diffusion") |
| >>> pipeline.scheduler = EulerDiscreteScheduler.from_config(pipeline.scheduler.config) |
|
|
| >>> # or |
| >>> euler_scheduler = EulerDiscreteScheduler.from_pretrained("shi-labs/versatile-diffusion", subfolder="scheduler") |
| >>> pipeline = VersatileDiffusionPipeline.from_pretrained("shi-labs/versatile-diffusion", scheduler=euler_scheduler) |
| ``` |
|
|
| ## VersatileDiffusionPipeline |
| [[autodoc]] VersatileDiffusionPipeline |
|
|
| ## VersatileDiffusionTextToImagePipeline |
| [[autodoc]] VersatileDiffusionTextToImagePipeline |
| - all |
| - __call__ |
|
|
| ## VersatileDiffusionImageVariationPipeline |
| [[autodoc]] VersatileDiffusionImageVariationPipeline |
| - all |
| - __call__ |
|
|
| ## VersatileDiffusionDualGuidedPipeline |
| [[autodoc]] VersatileDiffusionDualGuidedPipeline |
| - all |
| - __call__ |
|
|