Run this model with HF Jobs
Run CrucibleAI/ControlNetMediaPipeFace on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/CrucibleAI/ControlNetMediaPipeFace. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/CrucibleAI/ControlNetMediaPipeFace on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use CrucibleAI/ControlNetMediaPipeFace with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use CrucibleAI/ControlNetMediaPipeFace with Diffusers:
pip install -U diffusers transformers accelerate
from diffusers import ControlNetModel, StableDiffusionControlNetPipeline controlnet = ControlNetModel.from_pretrained("CrucibleAI/ControlNetMediaPipeFace") pipe = StableDiffusionControlNetPipeline.from_pretrained( "stabilityai/stable-diffusion-2-1-base", controlnet=controlnet ) - MediaPipe
How to use CrucibleAI/ControlNetMediaPipeFace with MediaPipe:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Commit ·
7610200
1
Parent(s): f3e7dd8
Add Diffusers weights (#6)
Browse files- upload diffusers (f182414fe08712897ad2303fd70016f6a55bf3cf)
- correct (1e93c51ebfd257020ae423c0755016a84afd2aa8)
Co-authored-by: Patrick von Platen <patrickvonplaten@users.noreply.huggingface.co>
Files changed (6)
- README.md+39
- config.jsonAdded+47
- diffusion_pytorch_model.binAdded+3
- diffusion_pytorch_model.fp16.binAdded+3
- diffusion_pytorch_model.fp16.safetensorsAdded+3
- diffusion_pytorch_model.safetensorsAdded+3
7 unmodified lines891011121396 unmodified lines1101111121131141157 unmodified lines- face- mediapipelicense: "openrail"datasets:- LAION-Face- LAION96 unmodified linesThe model has some limitations: while it is empirically better at tracking gaze and mouth poses than previous attempts, it may still ignore controls. Adding details to the prompt like, "looking right" can abate bad behavior.# License:7 unmodified lines89101112131496 unmodified lines1111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531547 unmodified lines- face- mediapipelicense: "openrail"base_model: stabilityai/stable-diffusion-2-1-basedatasets:- LAION-Face- LAION96 unmodified linesThe model has some limitations: while it is empirically better at tracking gaze and mouth poses than previous attempts, it may still ignore controls. Adding details to the prompt like, "looking right" can abate bad behavior.## 🧨 DiffusersIt is recommended to use the checkpoint with [Stable Diffusion 2.1 - Base](stabilityai/stable-diffusion-2-1-base) as the checkpoint has been trained on it.Experimentally, the checkpoint can be used with other diffusion models such as dreamboothed stable diffusion.1. Let's install `diffusers` and related packages:```$ pip install diffusers transformers accelerate```2. Run code:```pyfrom PIL import Imageimport numpy as npimport torchfrom diffusers import StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepSchedulerfrom diffusers.utils import load_imageimage = load_image("https://huggingface.co/CrucibleAI/ControlNetMediaPipeFace/resolve/main/samples_laion_face_dataset/family_annotation.png")controlnet = ControlNetModel.from_pretrained("CrucibleAI/ControlNetMediaPipeFace", torch_dtype=torch.float16, variant="fp16")pipe = StableDiffusionControlNetPipeline.from_pretrained("stabilityai/stable-diffusion-2-1-base", controlnet=controlnet, safety_checker=None, torch_dtype=torch.float16)pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)# Remove if you do not have xformers installed# see https://huggingface.co/docs/diffusers/v0.13.0/en/optimization/xformers#installing-xformers# for installation instructionspipe.enable_xformers_memory_efficient_attention()pipe.enable_model_cpu_offload()image = pipe("a happy family at a dentist advertisement", image=image, num_inference_steps=30).images[0]image.save('./images.png')```# License:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647{ "_class_name": "ControlNetModel", "_diffusers_version": "0.15.0.dev0", "_name_or_path": "/home/patrick_huggingface_co/temp_control", "act_fn": "silu", "attention_head_dim": [ 5, 10, 20, 20 ], "block_out_channels": [ 320, 640, 1280, 1280 ], "class_embed_type": null, "conditioning_embedding_out_channels": [ 16, 32, 96, 256 ], "controlnet_conditioning_channel_order": "rgb", "cross_attention_dim": 1024, "down_block_types": [ "CrossAttnDownBlock2D", "CrossAttnDownBlock2D", "CrossAttnDownBlock2D", "DownBlock2D" ], "downsample_padding": 1, "flip_sin_to_cos": true, "freq_shift": 0, "in_channels": 4, "layers_per_block": 2, "mid_block_scale_factor": 1, "norm_eps": 1e-05, "norm_num_groups": 32, "num_class_embeds": null, "only_cross_attention": false, "projection_class_embeddings_input_dim": null, "resnet_time_scale_shift": "default", "upcast_attention": false, "use_linear_projection": true}123version https://git-lfs.github.com/spec/v1oid sha256:36dcd318d499df44b35432599a1b70f598e7bb42b479e4e67d4adf7b7e87e87dsize 1457051321123version https://git-lfs.github.com/spec/v1oid sha256:7f70c38860e0d1fcd0f5ed38bc34e61c7337b9001bed57f7bff6eba6471406f0size 728596455123version https://git-lfs.github.com/spec/v1oid sha256:02b3a8e04154b4c3d11f5210217f0dbf3fac8612d62d015cd059f2b9fe4c3364size 728496846123version https://git-lfs.github.com/spec/v1oid sha256:a683e98e2427fd6242edc9af6620708f2f8fc84bfc049fafe549e350f8d42d73size 1456953564README.md+39
config.jsonAdded+47
diffusion_pytorch_model.binAdded+3
diffusion_pytorch_model.fp16.binAdded+3
diffusion_pytorch_model.fp16.safetensorsAdded+3
diffusion_pytorch_model.safetensorsAdded+3