How to use from the
Use from the
Diffusers library
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline

# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("tensorart/SD3.5M-Controlnet-Canny", dtype=torch.bfloat16, device_map="cuda")

prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]

TensorArt Stable Diffusion 3.5 Medium ControlNet Canny

With SD3.5M

import torch
from diffusers import StableDiffusion3ControlNetPipeline
from diffusers import SD3ControlNetModel
from diffusers.utils import load_image

controlnet = SD3ControlNetModel.from_pretrained("tensorart/SD3.5M-Controlnet-Canny")
pipe = StableDiffusion3ControlNetPipeline.from_pretrained(
    "stabilityai/stable-diffusion-3.5-medium",
    controlnet=controlnet
)
pipe.to("cuda", torch.float16)

control_image = load_image("https://huggingface.co/tensorart/SD3.5M-Controlnet-Canny/resolve/main/asset/canny.png")
prompt = "An eye"
negative_prompt = "low quality, worst quality, deformed, distorted, disfigured, motion smear, motion artifacts, fused fingers, bad anatomy, weird hand, ugly, monochrome"

image = pipe(
    prompt, 
    num_inference_steps=30,
    negative_prompt=negative_prompt, 
    control_image=control_image, 
    guidance_scale=4.5,
    controlnet_conditioning_scale=0.8
).images[0]
image.save('image.jpg')

With TensorArt's SD3.5M Turbo

import torch
from diffusers import StableDiffusion3ControlNetPipeline
from diffusers import SD3ControlNetModel
from diffusers.utils import load_image

controlnet = SD3ControlNetModel.from_pretrained("tensorart/SD3.5M-Controlnet-Canny")
pipe = StableDiffusion3ControlNetPipeline.from_pretrained(
    "tensorart/stable-diffusion-3.5-medium-turbo",
    controlnet=controlnet
)
pipe.to("cuda", torch.float16)

control_image = load_image("https://huggingface.co/tensorart/SD3.5M-Controlnet-Canny/resolve/main/asset/canny.png")
prompt = "An eye"
negative_prompt = "low quality, worst quality, deformed, distorted, disfigured, motion smear, motion artifacts, fused fingers, bad anatomy, weird hand, ugly, monochrome"

image = pipe(
    prompt, 
    num_inference_steps=8,
    negative_prompt=negative_prompt, 
    control_image=control_image, 
    guidance_scale=1.5,
    controlnet_conditioning_scale=0.8
).images[0]
image.save('image.jpg')

Contact

Downloads last month
16
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for tensorart/SD3.5M-Controlnet-Canny

Finetuned
(66)
this model