tensorart/SD3.5M-Controlnet-Canny
246
1---2license: other3license_name: stabilityai-ai-community4license_link: LICENSE.md5language:6- en7base_model:8- stabilityai/stable-diffusion-3.5-medium9pipeline_tag: text-to-image10---11 12<div align="center">13 14**TensorArt Stable Diffusion 3.5 Medium ControlNet Canny**15 16<img src="./asset/demo.png"/>17</div>18 19# With SD3.5M20```python21import torch22from diffusers import StableDiffusion3ControlNetPipeline23from diffusers import SD3ControlNetModel24from diffusers.utils import load_image25 26controlnet = SD3ControlNetModel.from_pretrained("tensorart/SD3.5M-Controlnet-Canny")27pipe = StableDiffusion3ControlNetPipeline.from_pretrained(28 "stabilityai/stable-diffusion-3.5-medium",29 controlnet=controlnet30)31pipe.to("cuda", torch.float16)32 33control_image = load_image("https://huggingface.co/tensorart/SD3.5M-Controlnet-Canny/resolve/main/asset/canny.png")34prompt = "An eye"35negative_prompt = "low quality, worst quality, deformed, distorted, disfigured, motion smear, motion artifacts, fused fingers, bad anatomy, weird hand, ugly, monochrome"36 37image = pipe(38 prompt, 39 num_inference_steps=30,40 negative_prompt=negative_prompt, 41 control_image=control_image, 42 guidance_scale=4.5,43 controlnet_conditioning_scale=0.844).images[0]45image.save('image.jpg')46```47 48 49# With TensorArt's SD3.5M Turbo50```python51import torch52from diffusers import StableDiffusion3ControlNetPipeline53from diffusers import SD3ControlNetModel54from diffusers.utils import load_image55 56controlnet = SD3ControlNetModel.from_pretrained("tensorart/SD3.5M-Controlnet-Canny")57pipe = StableDiffusion3ControlNetPipeline.from_pretrained(58 "tensorart/stable-diffusion-3.5-medium-turbo",59 controlnet=controlnet60)61pipe.to("cuda", torch.float16)62 63control_image = load_image("https://huggingface.co/tensorart/SD3.5M-Controlnet-Canny/resolve/main/asset/canny.png")64prompt = "An eye"65negative_prompt = "low quality, worst quality, deformed, distorted, disfigured, motion smear, motion artifacts, fused fingers, bad anatomy, weird hand, ugly, monochrome"66 67image = pipe(68 prompt, 69 num_inference_steps=8,70 negative_prompt=negative_prompt, 71 control_image=control_image, 72 guidance_scale=1.5,73 controlnet_conditioning_scale=0.874).images[0]75image.save('image.jpg')76```77 78## Contact79* Website: https://tensor.art https://tusiart.com80* Developed by: TensorArt81 