news 2026/7/7 14:36:55

第六十二篇-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/7/7 11:09:31

一个基于 .NET + Vue3 开源、免费、精美的通用业务型后台管理系统

致力于挖掘功能强大、性能优越、创新前沿且简单易用的 C#/.NET 开源框架、项目、类库与工具。助力 .NET 开发者轻松解锁并运用这些实用的宝藏资源&#xff0c;提升开发效率与创新能力&#xff01;项目概述SimpleAdmin 是一个基于 .NET Vue3 开发的通用业务型后台管理系统&…

作者头像 李华
网站建设 2026/7/7 18:48:11

如何为LobeChat添加身份认证以保护内部AI系统安全?

如何为 LobeChat 添加身份认证以保护内部 AI 系统安全 在企业逐步将大语言模型&#xff08;LLM&#xff09;引入办公流程的今天&#xff0c;一个直观、易用的前端界面往往决定了 AI 工具能否真正落地。LobeChat 凭借其现代化的设计、对多种模型的无缝支持以及灵活的插件体系&a…

作者头像 李华
网站建设 2026/7/6 18:53:07

数据编目与元数据管理:不可不知的关系

数据编目与元数据管理&#xff1a;像图书馆管理员和藏书索引的共生密码 关键词 数据编目、元数据管理、数据治理、数据资产、元数据模型、数据目录、数据发现 摘要 你有没有过这样的经历&#xff1f;打开企业的数据平台&#xff0c;看到几百张表名像乱码的数据库表&#xff08;…

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

Safari浏览器特殊配置:iOS设备上的最佳实践

Safari浏览器特殊配置&#xff1a;iOS设备上的最佳实践 在移动互联网高度成熟的今天&#xff0c;用户早已不再满足于“能用”的网页体验——他们期待的是流畅、智能、无缝的交互。而当你的 Web 应用承载着语音识别、实时流式响应、文件上传等复杂功能时&#xff0c;一个看似普…

作者头像 李华
网站建设 2026/7/7 15:09:10

大数据升级之路 | Storm理论详解

随着越来越多的场景对Hadoop的MapReduce高延迟无法容忍&#xff0c;比如网站统计、推荐系统、预警系统、金融系统(高频交易、股票)等等&#xff0c;大数据实时处理解决方案&#xff08;流计算&#xff09;的应用日趋广泛&#xff0c;目前已是分布式技术领域最新爆发点&#xff…

作者头像 李华
网站建设 2026/7/7 7:36:59

字节新论文:通过Context-Folding记忆折叠实现复杂Agent

摘要 今天一起看下字节新出论文《Scaling Long-Horizon LLM Agent via Context-Folding》。 在构建长程(Long-Horizon)Agent 时,上下文窗口的线性增长与注意力的二次方开销是制约模型推理能力与运行效率的核心瓶颈。不同于传统的 RAG 或基于摘要的被动压缩,字节提出的Cont…

作者头像 李华