dragynir commited on
Commit
9d5ecbc
1 Parent(s): ffa11fe

Add controlnet model

Browse files
.gitignore CHANGED
@@ -5,8 +5,8 @@ __pycache__/
5
 
6
 
7
  # Weights artefacts
8
- *.pth
9
- *.safetensors
10
 
11
  # C extensions
12
  *.so
 
5
 
6
 
7
  # Weights artefacts
8
+ #*.pth
9
+ #*.safetensors
10
 
11
  # C extensions
12
  *.so
README.md CHANGED
@@ -21,7 +21,7 @@ a handsome man relaxing in a chair, shirt widely unbuttoned, eyes closed, close
21
  # TODO
22
 
23
  [x] изучить как обернуть в huggingface app
24
- [ ] запушить модель
25
  [ ] Пример как можно сделать апку: https://huggingface.co/spaces/wildoctopus/cloth-segmentation/tree/main
26
  [ ] Написать UI с RGB цветами (чтобы можно было одежду по шаблону а не изображению генерить)
27
  [ ] Добавить seed в параметры
 
21
  # TODO
22
 
23
  [x] изучить как обернуть в huggingface app
24
+ [ ] запушить модель (https://huggingface.co/docs/hub/repositories-getting-started)
25
  [ ] Пример как можно сделать апку: https://huggingface.co/spaces/wildoctopus/cloth-segmentation/tree/main
26
  [ ] Написать UI с RGB цветами (чтобы можно было одежду по шаблону а не изображению генерить)
27
  [ ] Добавить seed в параметры
config.py CHANGED
@@ -12,11 +12,9 @@ class PipelineConfig:
12
  """Fashion Controlnet Pipeline Config."""
13
 
14
  base_model_path: str = 'stabilityai/stable-diffusion-xl-base-1.0'
15
- # /pub/home/korostelev/.cache/huggingface/hub/models--stabilityai--stable-diffusion-xl-base-1.0/snapshots/462165984030d82259a11f4367a4eed129e94a7b'
16
 
17
- controlnet_path: str = r"C:\Users\dragynir\.cache\huggingface\hub\fashion_controlnet"
18
-
19
- # https://huggingface.co/madebyollin/sdxl-vae-fp16-fix
20
  vae_path: str = 'madebyollin/sdxl-vae-fp16-fix'
21
 
 
 
22
  segmentation_model_path: str = os.path.join(weights_path, 'cloth_segm.pth')
 
12
  """Fashion Controlnet Pipeline Config."""
13
 
14
  base_model_path: str = 'stabilityai/stable-diffusion-xl-base-1.0'
 
15
 
 
 
 
16
  vae_path: str = 'madebyollin/sdxl-vae-fp16-fix'
17
 
18
+ controlnet_path: str = os.path.join(weights_path, 'controlnet')
19
+
20
  segmentation_model_path: str = os.path.join(weights_path, 'cloth_segm.pth')
weights/controlnet/config.json ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "ControlNetModel",
3
+ "_diffusers_version": "0.25.0.dev0",
4
+ "act_fn": "silu",
5
+ "addition_embed_type": "text_time",
6
+ "addition_embed_type_num_heads": 64,
7
+ "addition_time_embed_dim": 256,
8
+ "attention_head_dim": [
9
+ 5,
10
+ 10,
11
+ 20
12
+ ],
13
+ "block_out_channels": [
14
+ 320,
15
+ 640,
16
+ 1280
17
+ ],
18
+ "class_embed_type": null,
19
+ "conditioning_channels": 3,
20
+ "conditioning_embedding_out_channels": [
21
+ 16,
22
+ 32,
23
+ 96,
24
+ 256
25
+ ],
26
+ "controlnet_conditioning_channel_order": "rgb",
27
+ "cross_attention_dim": 2048,
28
+ "down_block_types": [
29
+ "DownBlock2D",
30
+ "CrossAttnDownBlock2D",
31
+ "CrossAttnDownBlock2D"
32
+ ],
33
+ "downsample_padding": 1,
34
+ "encoder_hid_dim": null,
35
+ "encoder_hid_dim_type": null,
36
+ "flip_sin_to_cos": true,
37
+ "freq_shift": 0,
38
+ "global_pool_conditions": false,
39
+ "in_channels": 4,
40
+ "layers_per_block": 2,
41
+ "mid_block_scale_factor": 1,
42
+ "mid_block_type": "UNetMidBlock2DCrossAttn",
43
+ "norm_eps": 1e-05,
44
+ "norm_num_groups": 32,
45
+ "num_attention_heads": null,
46
+ "num_class_embeds": null,
47
+ "only_cross_attention": false,
48
+ "projection_class_embeddings_input_dim": 2816,
49
+ "resnet_time_scale_shift": "default",
50
+ "transformer_layers_per_block": [
51
+ 1,
52
+ 2,
53
+ 10
54
+ ],
55
+ "upcast_attention": null,
56
+ "use_linear_projection": true
57
+ }
weights/controlnet/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f85f8ade2174d2757de3b00d302309d99e0b7995dc45f610ad9bf3d9aac95470
3
+ size 5004167864