# How to create a UNet2DConditionModel

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-create-a-unet2dconditionmodel%2F85182%3E%5C
**Category:** 🧨 Diffusers\
**Created:** [May 4, 2024, 8:16pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-create-a-unet2dconditionmodel%2F85182 "2024-05-04T20:16:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsy2140](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@jsy2140](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fjsy2140)%5C
**Post date:** [May 4, 2024, 8:16pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-create-a-unet2dconditionmodel%2F85182%2F1 "2024-05-04T20:16:56Z")

</div>

Hi everyone,

I’m a student and I’m trying to learn how to create diffusion models, but I found myself recently stuck with a problem.

I’m following this [guide](https://huggingface.co/docs/diffusers/tutorials/basic_training) on how to train a diffusion model from scratch using a [UNet2DModel](https://huggingface.co/docs/diffusers/v0.27.2/en/api/models/unet2d#diffusers.UNet2DModel). Now, I’m trying to change the UNet2DModel to a UNet2DConditionModel, so I can input the model with a description for every image in my dataset. I found a couple of resources on the internet on how to create a UNet2DConditionModel, but I only found examples using pre-trained models, and I want to train my UNet2DConditionModel from scratch like in the guide I mentioned using my dataset that contains images with a corresponding description.

Does anyone know how to achieve this? On how to create and train a UNet2DConditionModel from scratch so I can input the model with an image and its description.

I appreciate any help you can provide.
