Commit
·
fda771d
1
Parent(s):
1008d5d
remove incorrect checkpoint
Browse files- config.json +0 -42
- control_net_depth.py +0 -54
- diffusion_pytorch_model.bin +0 -3
- diffusion_pytorch_model.fp16.bin +0 -3
- diffusion_pytorch_model.fp16.safetensors +0 -3
- diffusion_pytorch_model.safetensors +0 -3
config.json
DELETED
@@ -1,42 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"_class_name": "ControlNetModel",
|
3 |
-
"_diffusers_version": "0.16.0.dev0",
|
4 |
-
"_name_or_path": "/home/patrick/controlnet_v1_1/control_v11p_sd15_depth",
|
5 |
-
"act_fn": "silu",
|
6 |
-
"attention_head_dim": 8,
|
7 |
-
"block_out_channels": [
|
8 |
-
320,
|
9 |
-
640,
|
10 |
-
1280,
|
11 |
-
1280
|
12 |
-
],
|
13 |
-
"class_embed_type": null,
|
14 |
-
"conditioning_embedding_out_channels": [
|
15 |
-
16,
|
16 |
-
32,
|
17 |
-
96,
|
18 |
-
256
|
19 |
-
],
|
20 |
-
"controlnet_conditioning_channel_order": "rgb",
|
21 |
-
"cross_attention_dim": 768,
|
22 |
-
"down_block_types": [
|
23 |
-
"CrossAttnDownBlock2D",
|
24 |
-
"CrossAttnDownBlock2D",
|
25 |
-
"CrossAttnDownBlock2D",
|
26 |
-
"DownBlock2D"
|
27 |
-
],
|
28 |
-
"downsample_padding": 1,
|
29 |
-
"flip_sin_to_cos": true,
|
30 |
-
"freq_shift": 0,
|
31 |
-
"in_channels": 4,
|
32 |
-
"layers_per_block": 2,
|
33 |
-
"mid_block_scale_factor": 1,
|
34 |
-
"norm_eps": 1e-05,
|
35 |
-
"norm_num_groups": 32,
|
36 |
-
"num_class_embeds": null,
|
37 |
-
"only_cross_attention": false,
|
38 |
-
"projection_class_embeddings_input_dim": null,
|
39 |
-
"resnet_time_scale_shift": "default",
|
40 |
-
"upcast_attention": false,
|
41 |
-
"use_linear_projection": false
|
42 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
control_net_depth.py
DELETED
@@ -1,54 +0,0 @@
|
|
1 |
-
#!/usr/bin/env python3
|
2 |
-
import torch
|
3 |
-
import os
|
4 |
-
from huggingface_hub import HfApi
|
5 |
-
from pathlib import Path
|
6 |
-
from diffusers.utils import load_image
|
7 |
-
from PIL import Image
|
8 |
-
import numpy as np
|
9 |
-
from transformers import pipeline
|
10 |
-
|
11 |
-
from diffusers import (
|
12 |
-
ControlNetModel,
|
13 |
-
StableDiffusionControlNetPipeline,
|
14 |
-
UniPCMultistepScheduler,
|
15 |
-
)
|
16 |
-
import sys
|
17 |
-
|
18 |
-
checkpoint = sys.argv[1]
|
19 |
-
|
20 |
-
image = load_image("https://huggingface.co/lllyasviel/sd-controlnet-depth/resolve/main/images/stormtrooper.png")
|
21 |
-
|
22 |
-
prompt = "Stormtrooper's lecture in beautiful lecture hall"
|
23 |
-
|
24 |
-
|
25 |
-
depth_estimator = pipeline('depth-estimation')
|
26 |
-
image = depth_estimator(image)['depth']
|
27 |
-
image = np.array(image)
|
28 |
-
image = image[:, :, None]
|
29 |
-
image = np.concatenate([image, image, image], axis=2)
|
30 |
-
image = Image.fromarray(image)
|
31 |
-
|
32 |
-
controlnet = ControlNetModel.from_pretrained(checkpoint, torch_dtype=torch.float16)
|
33 |
-
pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
34 |
-
"runwayml/stable-diffusion-v1-5", controlnet=controlnet, torch_dtype=torch.float16
|
35 |
-
)
|
36 |
-
|
37 |
-
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
38 |
-
pipe.enable_model_cpu_offload()
|
39 |
-
|
40 |
-
generator = torch.manual_seed(0)
|
41 |
-
out_image = pipe(prompt, num_inference_steps=40, generator=generator, image=image).images[0]
|
42 |
-
|
43 |
-
path = os.path.join(Path.home(), "images", "aa.png")
|
44 |
-
out_image.save(path)
|
45 |
-
|
46 |
-
api = HfApi()
|
47 |
-
|
48 |
-
api.upload_file(
|
49 |
-
path_or_fileobj=path,
|
50 |
-
path_in_repo=path.split("/")[-1],
|
51 |
-
repo_id="patrickvonplaten/images",
|
52 |
-
repo_type="dataset",
|
53 |
-
)
|
54 |
-
print("https://huggingface.co/datasets/patrickvonplaten/images/blob/main/aa.png")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
diffusion_pytorch_model.bin
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:a8548cc16e95fc3677ae18d12a74bb19bcf1ba3762222bef3c2e5ae99941919a
|
3 |
-
size 1445254969
|
|
|
|
|
|
|
|
diffusion_pytorch_model.fp16.bin
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:40de890759f5be24a66473b78877557264aa4dc33fbbb3538fce24dc53c784e2
|
3 |
-
size 722698343
|
|
|
|
|
|
|
|
diffusion_pytorch_model.fp16.safetensors
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:f02e94f47b9a4007f1127dc923e1722510427365d44369371805755633604078
|
3 |
-
size 722598642
|
|
|
|
|
|
|
|
diffusion_pytorch_model.safetensors
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:2ae308d4775bced11bd359aaf742635c179bf1891756f53db364b22a9bcc1975
|
3 |
-
size 1445157124
|
|
|
|
|
|
|
|