Comments (2)
Hi @Johnson-yue,
We don't have any examples for class-conditional diffusion just yet, but you already can train your own model for that!
UNet2DConditionModel
's forward()
function exposes an encoder_hidden_states
parameter: https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/unet_2d_condition.py#L118
So you can encode the class labels in your preferred way (for example, using torch.nn.Embedding
s and a couple of Linear
layers) and pass them to the UNet during training and inference 🙂
from diffusers.
@anton-l Even though it is possible to provide the encoder_hidden_states
while training, the DDPMPipeline
has no mechanism to provide encoder_hidden_states
during inference.
from diffusers.
Related Issues (20)
- `StableDiffusionXLControlNetInpaintPipeline` not working with IP-Adapter when using `ip_adapter_image_embeds` parameter. HOT 1
- stabilityai/stable-diffusion-2-1 does not appear to have a file named config.json. HOT 3
- Load local safetensors file raised invalid json format HOT 3
- fail to load modal from same folder HOT 2
- [ko] Translating docs(Conceptual Guides) to Korean. HOT 3
- Combining community pipeline for image generation HOT 3
- custom_pipeline not being cached
- Support MuLan, a plug-and-play language adapter to adapt existing diffusion model for up to 110+ languages without additional training
- PyTorch 2.3.0 Incompatibility with Current Diffusers Library HOT 5
- Add support for custom CLIPTextModelWithProjection in SDXL for new language training
- how can i know what the model base are HOT 2
- ConsistentID: Portrait Generation with Multimodal Fine-Grained Identity Preservation
- How to implement `IPAdapterAttnProcessor2_0` with xformers
- [training examples] reduce complexity by running final validations before export
- SDXL Training Fails for Multi GPU Machine HOT 6
- Instruct-pix2pix pipeline: add ability to pass `cross_attention_kwargs` in call method HOT 2
- Attention in Motion Module of UNetMotionModel HOT 1
- Increasing RAM usage with enable_model_cpu_offload HOT 6
- Type mismatch for LEDITS++ HOT 1
- Bug: Inpaint with IP Adapter (face+style) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diffusers.