Skip to main content

ControlNet auxiliary models

This is a PyPi installable package of lllyasviel's ControlNet Annotators

The code is copy-pasted from the respective folders in https://github.com/lllyasviel/ControlNet/tree/main/annotator and connected to the 🤗 Hub.

All credit & copyright goes to https://github.com/lllyasviel .

Install

pip install controlnet-aux==0.0.3

Usage

from PIL import Image
import requests
from io import BytesIO
from controlnet_aux import HEDdetector, MidasDetector, MLSDdetector, OpenposeDetector, PidiNetDetector, NormalBaeDetector, LineartDetector, LineartAnimeDetector, CannyDetector, ContentShuffleDetector, ZoeDetector, MediapipeFaceDetector

# load image
url = "https://huggingface.co/lllyasviel/sd-controlnet-openpose/resolve/main/images/pose.png"

response = requests.get(url)
img = Image.open(BytesIO(response.content)).convert("RGB").resize((512, 512))

# load checkpoints
hed = HEDdetector.from_pretrained("lllyasviel/Annotators")
midas = MidasDetector.from_pretrained("lllyasviel/Annotators")
mlsd = MLSDdetector.from_pretrained("lllyasviel/Annotators")
open_pose = OpenposeDetector.from_pretrained("lllyasviel/Annotators")
pidi = PidiNetDetector.from_pretrained("lllyasviel/Annotators")
normal_bae = NormalBaeDetector.from_pretrained("lllyasviel/Annotators")
lineart = LineartDetector.from_pretrained("lllyasviel/Annotators")
lineart_anime = LineartAnimeDetector.from_pretrained("lllyasviel/Annotators")
zoe = ZoeDetector.from_pretrained("lllyasviel/Annotators")

# instantiate
canny = CannyDetector()
content = ContentShuffleDetector()
face_detector = MediapipeFaceDetector()


# process
processed_image_hed = hed(img)
processed_image_midas = midas(img)
processed_image_mlsd = mlsd(img)
processed_image_open_pose = open_pose(img, hand_and_face=True)
processed_image_pidi = pidi(img, safe=True)
processed_image_normal_bae = normal_bae(img)
processed_image_lineart = lineart(img, coarse=True)
processed_image_lineart_anime = lineart_anime(img)
processed_image_zoe = zoe(img)

processed_image_canny = canny(img)
processed_image_content = content(img)
processed_image_mediapipe_face = face_detector(img)

Metadata

Release files for controlnet-aux-voltaml 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for controlnet-aux-voltaml 0.3.2
File Size Uploaded
controlnet_aux_voltaml-0.3.2.tar.gz 134.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for controlnet-aux-voltaml 0.3.2
File Interpreter ABI Platform
controlnet_aux_voltaml-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 326.4 kB

Release files / controlnet_aux_voltaml-0.3.2.tar.gz

Download URL controlnet_aux_voltaml-0.3.2.tar.gz
Size 134.1 kB
Tags Source
SHA-256 checksum
How to use checksums
712f575b14042b7aa74e7b13ad04c4bc1de8bc9f4c0d02b52da4363026bba51b
BLAKE2b-256 checksum
How to use checksums
f5fe427d7d2ce1ca97f1c4d6c9b54a6fc070d97fb34c769cba8269e661a375ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / controlnet_aux_voltaml-0.3.2-py3-none-any.whl

Download URL controlnet_aux_voltaml-0.3.2-py3-none-any.whl
Size 192.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c382c2a3cc84a0f8ebde5a850df7c285b6a653d63847eec3f469d156abdaf582
BLAKE2b-256 checksum
How to use checksums
fc7c62597ce7e907292758b2ff8985fb154e4283607a031d4c95cc98e3d42e20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page