Instructions to use hf-internal-testing/tiny-controlnet-sdxl with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use hf-internal-testing/tiny-controlnet-sdxl with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("hf-internal-testing/tiny-controlnet-sdxl", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
This ControlNetModel was created using the code below:
from diffusers import ControlNetModel
from huggingface_hub import HfApi, create_repo
controlnet = ControlNetModel(
block_out_channels=(32, 64),
layers_per_block=2,
in_channels=4,
down_block_types=("DownBlock2D", "CrossAttnDownBlock2D"),
conditioning_embedding_out_channels=(16, 32),
# SD2-specific config below
attention_head_dim=(2, 4),
use_linear_projection=True,
addition_embed_type="text_time",
addition_time_embed_dim=8,
transformer_layers_per_block=(1, 2),
projection_class_embeddings_input_dim=80, # 6 * 8 + 32
cross_attention_dim=64,
)
local_path = "tiny-controlnet-sdxl"
controlnet.save_pretrained(local_path)
repo_id = create_repo(
repo_id=f"hf-internal-testing/{local_path}",
exist_ok=True
).repo_id
api = HfApi()
api.upload_folder(
repo_id=repo_id,
folder_path=local_path
)
Can be initialized like so:
from diffusers import ControlNetModel
controlnet = ControlNetModel.from_pretrained("hf-internal-testing/tiny-controlnet-sdxl")
- Downloads last month
- 561
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support