news 2026/6/23 21:21:49

第六十二篇-ComfyUI+V100-32G+代码运行Z-Image

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
第六十二篇-ComfyUI+V100-32G+代码运行Z-Image

环境

系统:CentOS-7 CPU : E5-2680V4 14核28线程 内存:DDR4 2133 32G * 2 显卡:Tesla V100-32G【PG503】 (水冷) 驱动: 535 CUDA: 12.2

依赖

pipinstalldiffusers -i https://mirrors.aliyun.com/pypi/simple

下载模型

pipinstallmodelscope -i https://mirrors.aliyun.com/pypi/simple modelscope download --model Tongyi-MAI/Z-Image-Turbo --local_dir /models/Z-Image-Turbo

代码

importtorch from diffusersimportZImagePipeline# 1. Load the pipeline# Use bfloat16 for optimal performance on supported GPUspipe=ZImagePipeline.from_pretrained("/models/Z-Image-Turbo",torch_dtype=torch.bfloat16,low_cpu_mem_usage=False,)pipe.to("cuda")# [Optional] Attention Backend# Diffusers uses SDPA by default. Switch to Flash Attention for better efficiency if supported:# pipe.transformer.set_attention_backend("flash") # Enable Flash-Attention-2# pipe.transformer.set_attention_backend("_flash_3") # Enable Flash-Attention-3# [Optional] Model Compilation# Compiling the DiT model accelerates inference, but the first run will take longer to compile.# pipe.transformer.compile()# [Optional] CPU Offloading# Enable CPU offloading for memory-constrained devices.# pipe.enable_model_cpu_offload()prompt="Young Chinese woman in red Hanfu, intricate embroidery. Impeccable makeup, red floral forehead pattern. Elaborate high bun, golden phoenix headdress, red flowers, beads. Holds round folding fan with lady, trees, bird. Neon lightning-bolt lamp (⚡️), bright yellow glow, above extended left palm. Soft-lit outdoor night background, silhouetted tiered pagoda (西安大雁塔), blurred colorful distant lights."# 2. Generate Imageimage=pipe(prompt=prompt,height=1024,width=1024,num_inference_steps=9,# This actually results in 8 DiT forwardsguidance_scale=0.0,# Guidance should be 0 for the Turbo modelsgenerator=torch.Generator("cuda").manual_seed(42),).images[0]image.save("example.png")

运行

exportHF_ENDPOINT=https://hf-mirror.com python run-1.py

参数

1024 * 1024

时间

(comfyui)[root@ai-server Z-Image]# python run-1.pyLoading pipeline components...:20%|█████████▏|1/5[00:00<00:01,2.15it/s]`torch_dtype`is deprecated!Use`dtype`instead!Loading checkpoint shards:100%|███████████████████████████████████████████████████|3/3[00:00<00:00,47.55it/s]Loading checkpoint shards:100%|███████████████████████████████████████████████████|3/3[00:09<00:00,3.11s/it]Loading pipeline components...:100%|██████████████████████████████████████████████|5/5[00:10<00:00,2.06s/it]100%|██████████████████████████████████████████████████████████████████████████████|9/9[00:57<00:00,6.35s/it]

GPU

Tue Dec1623:15:592025+---------------------------------------------------------------------------------------+|NVIDIA-SMI535.129.03 Driver Version:535.129.03 CUDA Version:12.2||-----------------------------------------+----------------------+----------------------+|GPU Name Persistence-M|Bus-Id Disp.A|Volatile Uncorr. ECC||Fan Temp Perf Pwr:Usage/Cap|Memory-Usage|GPU-Util Compute M.||||MIG M.||=========================================+======================+======================||0Tesla PG503-216 On|00000000:04:00.0 Off|0||N/A 35C P0 232W / 250W|29740MiB / 32768MiB|100% Default||||N/A|+-----------------------------------------+----------------------+----------------------+

效果

总结

速度还是可以的,1分钟。
最高占用30G,100%GPU占用。
效果后面继续测试,后续加入到ComfyUI中。

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/23 20:00:30

公司网站wordpress主题推荐

视频背景wordpress官网主题红色风格的wordpress主题&#xff0c;首页视频背景&#xff0c;鼠标滚动翻转展示内容&#xff0c;适合公司官网使用。https://www.jianzhanpress.com/?p7288服务类公司wordpress企业主题红色大气的wordpress企业主题&#xff0c;适合服务行业的公司搭…

作者头像 李华
网站建设 2026/6/23 20:42:30

金融从业者福音:LobeChat搭建合规AI分析助手

金融从业者福音&#xff1a;LobeChat搭建合规AI分析助手 在智能投研、客户画像和风险建模日益成为金融机构核心竞争力的今天&#xff0c;生成式AI正以前所未有的速度重塑行业格局。然而&#xff0c;一个现实困境始终挥之不去&#xff1a;如何在享受大语言模型强大能力的同时&am…

作者头像 李华
网站建设 2026/6/23 20:44:59

LobeChat科技新闻深度解读

LobeChat&#xff1a;重塑大语言模型交互体验的开源框架 在今天&#xff0c;几乎每个科技公司都在尝试接入大语言模型&#xff08;LLM&#xff09;&#xff0c;从客服机器人到内部知识助手&#xff0c;AI 正以前所未有的速度渗透进我们的工作流。但一个现实问题随之浮现&#x…

作者头像 李华
网站建设 2026/6/23 10:32:32

LinkedIn职业建议:LobeChat撰写个人简介

LinkedIn职业建议&#xff1a;LobeChat撰写个人简介 在求职竞争日益激烈的今天&#xff0c;一份出色的LinkedIn个人简介可能就是你与理想机会之间的最后一道桥梁。它不只是简历的电子版延伸&#xff0c;而是一个展示专业形象、传递职业价值的动态窗口。然而&#xff0c;很多人依…

作者头像 李华
网站建设 2026/6/23 19:30:54

9 个 MBA 论文降AI工具,AI 写作优化推荐

9 个 MBA 论文降AI工具&#xff0c;AI 写作优化推荐 论文写作的战场&#xff0c;你是否也在挣扎&#xff1f; MBA毕业论文不仅是对专业知识的总结&#xff0c;更是对个人研究能力和学术素养的全面检验。然而&#xff0c;对于许多MBA学生来说&#xff0c;这却是一场艰难的战役。…

作者头像 李华
网站建设 2026/6/23 19:32:08

10 个高效降AI率工具,自考党必备!

10 个高效降AI率工具&#xff0c;自考党必备&#xff01; AI降重工具&#xff1a;自考党论文的“隐形护盾” 在当前学术写作环境中&#xff0c;随着AI技术的广泛应用&#xff0c;论文中出现AIGC痕迹的风险显著增加。对于自考学生而言&#xff0c;如何在保证内容质量的同时降低查…

作者头像 李华