adams-story commited on
Commit
c91eb97
·
verified ·
1 Parent(s): 6d60088

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -0
README.md ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ This is the code used to create this model
2
+ ```
3
+ import torch
4
+ import diffusers
5
+
6
+
7
+ model = diffusers.UNet2DConditionModel(
8
+ block_out_channels=(4, 4, 4),
9
+ down_block_types=('CrossAttnDownBlock2D', 'CrossAttnDownBlock2D', 'CrossAttnDownBlock2D'),
10
+ up_block_types=('CrossAttnUpBlock2D', 'CrossAttnUpBlock2D', 'CrossAttnUpBlock2D'),
11
+ norm_num_groups=2,
12
+ cross_attention_dim=2,
13
+ layers_per_block=1,
14
+ attention_head_dim=2,
15
+ addition_embed_type_num_heads=2,
16
+ )
17
+
18
+ # noisy latent
19
+ x = torch.randn(7,4,33,33)
20
+ # timestep
21
+ t = torch.Tensor([1.0])
22
+ # conditioning embed
23
+ z = torch.randn(7, 4, 2)
24
+ # denoised latent
25
+ y = model(x, t, z)
26
+ ```