eliphatfs commited on
Commit
5031ea5
1 Parent(s): 73ef205

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. README.md +35 -0
  2. config.json +56 -0
  3. diffusion_pytorch_model.safetensors +3 -0
README.md CHANGED
@@ -1,3 +1,38 @@
1
  ---
2
  license: openrail
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: openrail
3
  ---
4
+
5
+ Recommended version of `diffusers` is `0.20.2` or `0.24.0` with `torch` `2`.
6
+
7
+ Usage Example:
8
+ ```python
9
+ import copy
10
+ import torch
11
+ import requests
12
+ from PIL import Image
13
+ from diffusers import DiffusionPipeline, EulerAncestralDiscreteScheduler, ControlNetModel
14
+
15
+ # Load the pipeline
16
+ pipeline: DiffusionPipeline = DiffusionPipeline.from_pretrained(
17
+ "sudo-ai/zero123plus-v1.2", custom_pipeline="sudo-ai/zero123plus-pipeline",
18
+ torch_dtype=torch.float16
19
+ )
20
+ normal_pipeline = copy.copy(pipeline)
21
+ normal_pipeline.add_controlnet(ControlNetModel.from_pretrained(
22
+ "sudo-ai/controlnet-zp12-normal-gen-v1", torch_dtype=torch.float16
23
+ ), conditioning_scale=1.0)
24
+ pipeline.to("cuda:0", torch.float16)
25
+ normal_pipeline.to("cuda:0", torch.float16)
26
+ # Run the pipeline
27
+ cond = Image.open(requests.get("https://d.skis.ltd/nrp/sample-data/0_cond.png", stream=True).raw)
28
+ genimg = pipeline(
29
+ cond,
30
+ prompt='', guidance_scale=4, num_inference_steps=75, width=640, height=960
31
+ ).images[0]
32
+ normalimg = normal_pipeline(
33
+ cond, depth_image=genimg,
34
+ prompt='', guidance_scale=4, num_inference_steps=50, width=640, height=960
35
+ ).images[0]
36
+ genimg.save("colors.png")
37
+ normalimg.save("normals.png")
38
+ ```
config.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "ControlNetModel",
3
+ "_diffusers_version": "0.24.0",
4
+ "act_fn": "silu",
5
+ "addition_embed_type": null,
6
+ "addition_embed_type_num_heads": 64,
7
+ "addition_time_embed_dim": null,
8
+ "attention_head_dim": [
9
+ 5,
10
+ 10,
11
+ 20,
12
+ 20
13
+ ],
14
+ "block_out_channels": [
15
+ 320,
16
+ 640,
17
+ 1280,
18
+ 1280
19
+ ],
20
+ "class_embed_type": null,
21
+ "conditioning_channels": 3,
22
+ "conditioning_embedding_out_channels": [
23
+ 16,
24
+ 32,
25
+ 96,
26
+ 256
27
+ ],
28
+ "controlnet_conditioning_channel_order": "rgb",
29
+ "cross_attention_dim": 1024,
30
+ "down_block_types": [
31
+ "CrossAttnDownBlock2D",
32
+ "CrossAttnDownBlock2D",
33
+ "CrossAttnDownBlock2D",
34
+ "DownBlock2D"
35
+ ],
36
+ "downsample_padding": 1,
37
+ "encoder_hid_dim": null,
38
+ "encoder_hid_dim_type": null,
39
+ "flip_sin_to_cos": true,
40
+ "freq_shift": 0,
41
+ "global_pool_conditions": false,
42
+ "in_channels": 4,
43
+ "layers_per_block": 2,
44
+ "mid_block_scale_factor": 1,
45
+ "mid_block_type": "UNetMidBlock2DCrossAttn",
46
+ "norm_eps": 1e-05,
47
+ "norm_num_groups": 32,
48
+ "num_attention_heads": null,
49
+ "num_class_embeds": null,
50
+ "only_cross_attention": false,
51
+ "projection_class_embeddings_input_dim": null,
52
+ "resnet_time_scale_shift": "default",
53
+ "transformer_layers_per_block": 1,
54
+ "upcast_attention": false,
55
+ "use_linear_projection": true
56
+ }
diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40c9b62a5eafd4e857468e641f884b51f6f7ad571d8b0b057b1ede1a828b4272
3
+ size 1456953560