Aller au contenu
ModelPrésentéExterne
Télécharger

HunyuanDiT v1.2 ControlNet Diffusers Canny

tencent-hunyuan-community

TypeControlNetVersiondiffusion_pytorch_modelCClasse

Source du modèle

Type
ControlNet
Taille du fichier
2,77 GB
Version
vdiffusion_pytorch_model
Mis à jour
6 oct. 2026
Téléchargements
747
Source
Hugging Face

Description de la source

from diffusers import HunyuanDiT2DControlNetModel, HunyuanDiTControlNetPipeline
import torch


controlnet = HunyuanDiT2DControlNetModel.from_pretrained("Tencent-Hunyuan/HunyuanDiT-v1.2-ControlNet-Diffusers-Canny", torch_dtype=torch.float16)

pipe = HunyuanDiTControlNetPipeline.from_pretrained("Tencent-Hunyuan/HunyuanDiT-v1.2-Diffusers-Distilled", controlnet=controlnet, torch_dtype=torch.float16)
pipe.to("cuda")

from diffusers.utils import load_image
cond_image = load_image('https://huggingface.co/Tencent-Hunyuan/HunyuanDiT-v1.2-ControlNet-Diffusers-Canny/resolve/main/canny.jpg?download=true')

## You may also use English prompt as HunyuanDiT supports both English and Chinese
prompt="在夜晚的酒店门前,一座古老的中国风格的狮子雕像矗立着,它的眼睛闪烁着光芒,仿佛在守护着这座建筑。背景是夜晚的酒店前,构图方式是特写,平视,居中构图。这张照片呈现了真实摄影风格,蕴含了中国雕塑文化,同时展现了神秘氛围"
#prompt="At night, an ancient Chinese-style lion statue stands in front of the hotel, its eyes gleaming as if guarding the building. The background is the hotel entrance at night, with a close-up, eye-level, and centered composition. This photo presents a realistic photographic style, embodies Chinese sculpture culture, and reveals a mysterious atmosphere."

torch.manual_seed(42)
image = pipe(
    prompt,
    negative_prompt='错误的眼睛,糟糕的人脸,毁容,糟糕的艺术,变形,多余的肢体,模糊的颜色,模糊,重复,病态,残缺,',
    height=1024,
    width=1024,
    guidance_scale=6.0,
    control_image=cond_image,
    num_inference_steps=50,
).images[0]

image.save('./image.png')

Sources

1 source
Hugging FacePrincipalVersion b2d21391ebcf78939344cfec84891932f9d53aa0
huggingface.co/Tencent-Hunyuan/HunyuanDiT-v1.2-ControlNet-Diffusers-Canny/tree/b2d21391ebcf78939344cfec84891932f9d53aa0

Vérifié 6 oct.

Artefacts du modèle

1 artefact

diffusion_pytorch_model.safetensors

safetensors · 2,77 GB · SHA-256 b12c2f44e678…587e · Hugging Face

Télécharger

Extraits de sources

3 extraits

--- license: other license_name: tencent-hunyuan-community license_link: https://huggingface.co/Tencent-Hunyuan/HunyuanDiT/blob/main/LICENSE.txt --- ```py from diffusers import HunyuanDiT2DControlNetModel, HunyuanDiTControlNetPipeline import torch controlnet = HunyuanDiT2DControlNetModel.from_pretrained("Tencent-Hunyuan/HunyuanDiT-v1.2-ControlNet-Diffusers-Canny", torch_dtype=torch.float16) pipe = HunyuanDiTControlNetPipeline.from_pretrained("Tencent-Hunyuan/HunyuanDiT-v1.2-Diffusers-Distilled", controlnet=controlnet, torch_dtype=torch.float16) pipe.to("cuda") from diffusers.utils import load_image cond_image = load_image('https://huggingface.co/Tencent-Hunyuan/HunyuanDiT-v1.2-ControlNet-Diffusers-Canny/resolve/main/canny.jpg?download=true') ## You may also use English prompt as HunyuanDiT supports both English and Chinese prompt="在夜晚的酒店门前,一座古老的中国风格的狮子雕像矗立着,它的眼睛闪烁着光芒,仿佛在守护着这座建筑。背景是夜晚的酒店前,构图方式是特写,平视,居中构图。这张照片呈现了真实摄影风格,蕴含了中国雕塑文化,同时展现了神秘氛围" #prompt="At night, an ancient Chinese-style lion statue stands in front of the hotel, its eyes gleaming as if guarding the building. The background is the hotel entrance at night, with a close-up, eye-level, and centered composition. This photo presents a realistic photographic style, embodies Chinese sculpture culture, and reveals a mysterious atmosphere." torch.manual_seed(42) image = pipe( prompt, negative_prompt='错误的眼睛,糟糕的人脸,毁容,糟糕的艺术,变形,多余的肢体,模糊的颜色,模糊,重复,病态,残缺,', height=1024, width=1024, guidance_scale=6.0, control_image=cond_image, num_inference_steps=50, ).images[0] image.save('./image.png') ```

Source context: 747 downloads · 0 likes · Library diffusers · Repo Tencent-Hunyuan/HunyuanDiT-v1.2-ControlNet-Diffusers-Canny

Source context: 20 downloads · 0 likes · Library diffusers · Repo Tencent-Hunyuan/HunyuanDiT-v1.2-ControlNet-Diffusers-Canny