stabilityai / stable-diffusion-3.5-large-controlnet-canny

huggingface.co
Total runs: 350
24-hour runs: 44
7-day runs: 120
30-day runs: 342
Model's Last Updated: 11月 28 2024
text-to-image

Introduction of stable-diffusion-3.5-large-controlnet-canny

Model Details of stable-diffusion-3.5-large-controlnet-canny

Stable Diffusion 3.5 Large Controlnet - Canny

ControlNet Demo Image

Model

This repository provides the Canny ControlNet for Stable Diffusion 3.5 Large. .

Please note: This model is released under the Stability Community License . Visit Stability AI to learn or contact us for commercial licensing details.

License

Here are the key components of the license:

  • Free for non-commercial use: Individuals and organizations can use the model free of charge for non-commercial use, including scientific research.
  • Free for commercial use (up to $1M in annual revenue): Startups, small to medium-sized businesses, and creators can use the model for commercial purposes at no cost, as long as their total annual revenue is less than $1M.
  • Ownership of outputs: Retain ownership of the media generated without restrictive licensing implications.

For organizations with annual revenue more than $1M, please contact us here to inquire about an Enterprise License.

Usage
Using Controlnets in SD3.5 Standalone Repo

Install the repo:

git clone git@github.com:Stability-AI/sd3.5.git
pip install -r requirements.txt

Then, download the models and sample images like so:

input/sample_cond.png
models/clip_g.safetensors
models/clip_l.safetensors
models/t5xxl.safetensors
models/sd3.5_large.safetensors
models/canny_8b.safetensors

and then you can run

python sd3_infer.py --controlnet_ckpt models/canny_8b.safetensors --controlnet_cond_image input/sample_cond.png --prompt "An adorable fluffy pastel creature"

Which should give you an image like below:

An adorable fluffy pastel creature

Using Controlnets in Diffusers

Make sure you upgrade to the latest version of diffusers: pip install -U diffusers . And then you can run:

import torch
from diffusers import StableDiffusion3ControlNetPipeline, SD3ControlNetModel
from diffusers.utils import load_image
from diffusers.image_processor import VaeImageProcessor

class SD3CannyImageProcessor(VaeImageProcessor):
    def __init__(self):
        super().__init__(do_normalize=False)
    def preprocess(self, image, **kwargs):
        image = super().preprocess(image, **kwargs)
        image = image * 255 * 0.5 + 0.5
        return image
    def postprocess(self, image, do_denormalize=True, **kwargs):
        do_denormalize = [True] * image.shape[0]
        image = super().postprocess(image, **kwargs, do_denormalize=do_denormalize)
        return image

controlnet = SD3ControlNetModel.from_pretrained("stabilityai/stable-diffusion-3.5-large-controlnet-canny", torch_dtype=torch.float16)
pipe = StableDiffusion3ControlNetPipeline.from_pretrained(
    "stabilityai/stable-diffusion-3.5-large",
    controlnet=controlnet,
    torch_dtype=torch.float16
).to("cuda")
pipe.image_processor = SD3CannyImageProcessor()

control_image = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/canny.png")
prompt =  "A Night time photo taken by Leica M11, portrait of a Japanese woman in a kimono, looking at the camera, Cherry blossoms"

generator = torch.Generator(device="cpu").manual_seed(0)
image = pipe(
    prompt, 
    control_image=control_image, 
    controlnet_conditioning_scale=1.0,
    guidance_scale=3.5,
    num_inference_steps=60,
    generator=generator,
    max_sequence_length=77,
).images[0]
image.save(f'canny-8b.jpg')
Preprocessing

An input image can be preprocessed for control use following the code snippet below. SD3.5 does not implement this behavior, so we recommend doing so in an external script beforehand.

import torchvision.transforms.functional as F
# assuming img is a PIL image
img = F.to_tensor(img)
img = cv2.cvtColor(img.transpose(1, 2, 0), cv2.COLOR_RGB2GRAY)
img = cv2.Canny(img, 100, 200)
Tips
  • We recommend starting with a ControlNet strength of 0.8, and adjusting as needed.
  • Euler sampler and a slightly higher step count (50-60) gives best results.
  • Pass --text_encoder_device <device_name> to load the text encoders directly to VRAM, which can speed up the full inference loop at the cost of extra VRAM usage.
Uses

All uses of the model must be in accordance with our Acceptable Use Policy .

Out-of-Scope Uses

The model was not trained to be factual or true representations of people or events. As such, using the model to generate such content is out-of-scope of the abilities of this model.

Training Data and Strategy

These models were trained on a wide variety of data, including synthetic data and filtered publicly available data.

Safety

We believe in safe, responsible AI practices and take deliberate measures to ensure Integrity starts at the early stages of development. This means we have taken and continue to take reasonable steps to prevent the misuse of Stable Diffusion 3.5 by bad actors. For more information about our approach to Safety please visit our Safety page .

Integrity Evaluation

Our integrity evaluation methods include structured evaluations and red-teaming testing for certain harms. Testing was conducted primarily in English and may not cover all possible harms.

Risks identified and mitigations:
  • Harmful content: We have used filtered data sets when training our models and implemented safeguards that attempt to strike the right balance between usefulness and preventing harm. However, this does not guarantee that all possible harmful content has been removed. All developers and deployers should exercise caution and implement content safety guardrails based on their specific product policies and application use cases.
  • Misuse: Technical limitations and developer and end-user education can help mitigate against malicious applications of models. All users are required to adhere to our Acceptable Use Policy, including when applying fine-tuning and prompt engineering mechanisms. Please reference the Stability AI Acceptable Use Policy for information on violative uses of our products.
  • Privacy violations: Developers and deployers are encouraged to adhere to privacy regulations with techniques that respect data privacy.
Acknowledgements
  • Lvmin Zhang, Anyi Rao, and Maneesh Agrawala, authors of the original ControlNet paper .
  • Lvmin Zhang, who also developed the Tile ControlNet , which inspired the Blur ControlNet.
  • Diffusers library authors, whose code was referenced during development.
  • InstantX team, whose Flux and SD3 ControlNets were also referenced during training.
  • All early testers and raters of the models, and the Stability AI team.
Contact

Please report any issues with the model or contact us:

Runs of stabilityai stable-diffusion-3.5-large-controlnet-canny on huggingface.co

350
Total runs
44
24-hour runs
68
3-day runs
120
7-day runs
342
30-day runs

More Information About stable-diffusion-3.5-large-controlnet-canny huggingface.co Model

More stable-diffusion-3.5-large-controlnet-canny license Visit here:

https://choosealicense.com/licenses/stabilityai-ai-community

stable-diffusion-3.5-large-controlnet-canny huggingface.co

stable-diffusion-3.5-large-controlnet-canny huggingface.co is an AI model on huggingface.co that provides stable-diffusion-3.5-large-controlnet-canny's model effect (), which can be used instantly with this stabilityai stable-diffusion-3.5-large-controlnet-canny model. huggingface.co supports a free trial of the stable-diffusion-3.5-large-controlnet-canny model, and also provides paid use of the stable-diffusion-3.5-large-controlnet-canny. Support call stable-diffusion-3.5-large-controlnet-canny model through api, including Node.js, Python, http.

stable-diffusion-3.5-large-controlnet-canny huggingface.co Url

https://huggingface.co/stabilityai/stable-diffusion-3.5-large-controlnet-canny

stabilityai stable-diffusion-3.5-large-controlnet-canny online free

stable-diffusion-3.5-large-controlnet-canny huggingface.co is an online trial and call api platform, which integrates stable-diffusion-3.5-large-controlnet-canny's modeling effects, including api services, and provides a free online trial of stable-diffusion-3.5-large-controlnet-canny, you can try stable-diffusion-3.5-large-controlnet-canny online for free by clicking the link below.

stabilityai stable-diffusion-3.5-large-controlnet-canny online free url in huggingface.co:

https://huggingface.co/stabilityai/stable-diffusion-3.5-large-controlnet-canny

stable-diffusion-3.5-large-controlnet-canny install

stable-diffusion-3.5-large-controlnet-canny is an open source model from GitHub that offers a free installation service, and any user can find stable-diffusion-3.5-large-controlnet-canny on GitHub to install. At the same time, huggingface.co provides the effect of stable-diffusion-3.5-large-controlnet-canny install, users can directly use stable-diffusion-3.5-large-controlnet-canny installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

stable-diffusion-3.5-large-controlnet-canny install url in huggingface.co:

https://huggingface.co/stabilityai/stable-diffusion-3.5-large-controlnet-canny

Url of stable-diffusion-3.5-large-controlnet-canny

stable-diffusion-3.5-large-controlnet-canny huggingface.co Url

Provider of stable-diffusion-3.5-large-controlnet-canny huggingface.co

stabilityai
ORGANIZATIONS

Other API from stabilityai

huggingface.co

Total runs: 143.2K
Run Growth: 8.3K
Growth Rate: 5.81%
Updated: 8月 04 2023
huggingface.co

Total runs: 137.2K
Run Growth: 16.4K
Growth Rate: 11.93%
Updated: 7月 10 2024
huggingface.co

Total runs: 34.3K
Run Growth: 3.4K
Growth Rate: 10.04%
Updated: 8月 09 2024
huggingface.co

Total runs: 378
Run Growth: -97.9K
Growth Rate: -25898.41%
Updated: 8月 03 2024
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated: 7月 10 2024
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated: 4月 13 2024