diff --git a/.gitattributes b/.gitattributes index 6c10c9a0..63f10611 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,3 +6,4 @@ .github/workflows/*.yml text eol=lf auto-translations/** text eol=lf localized-playbooks/** text eol=lf +localized-playbooks/**/*.png binary \ No newline at end of file diff --git a/localized-playbooks/zh-CN/core/comfyui-image-gen/README.md b/localized-playbooks/zh-CN/core/comfyui-image-gen/README.md new file mode 100644 index 00000000..adcea7b1 --- /dev/null +++ b/localized-playbooks/zh-CN/core/comfyui-image-gen/README.md @@ -0,0 +1,632 @@ + + + +> [!IMPORTANT] +> 本手册使用了 GitHub 无法渲染的特殊标签。请访问 [amd.com/playbooks](https://amd.com/playbooks) 以正确预览此内容。 + + +## 概述 + +ComfyUI 是一个功能强大、基于节点的 Stable Diffusion 及其他扩散模型界面。与传统的仅有简单提示框的文生图界面不同,ComfyUI 将整个图像生成流程以可视化图表的形式呈现出来,让您能够对从文本编码到隐空间操作再到最终解码的每一个步骤进行精细控制。 + +本教程将教您如何在您的 GPU 上使用 ComfyUI 搭配 Z Image Turbo 模型来生成高质量的 AI 图像。 + +## 您将学到什么 + +- 如何启动 ComfyUI 并加载 Z-Image Turbo 模板 +- 理解扩散流程的各个组件 +- 生成图像并调整生成参数 +- 保存和分享工作流 + +## 设置内存配置 + + + + +## 检查软件更新 + + + + +## 安装软件先决条件 + + + + + + + + +**授予您的用户访问 GPU 设备的权限**(需要注销并重新登录才能生效): + +```bash +sudo usermod -aG render,video $LOGNAME +``` + +#### 创建虚拟环境 +在 Linux 上,打开您选择的目录中的终端,运行以下命令以创建 venv: + + +```bash +sudo apt update +sudo apt install -y python3-venv +python3 -m venv comfyui-env +source comfyui-env/bin/activate +``` + + + + + + + + + +```powershell +# The new Comfy Desktop (since June 2026) installs into %LOCALAPPDATA%\Comfy-Desktop\ +# Layout: ComfyUI-Installs\\ComfyUI\ holds main.py + .venv +# ComfyUI-Shared\ holds the shared model library +$instBase = Join-Path $env:LOCALAPPDATA "Comfy-Desktop\ComfyUI-Installs\ComfyUI" +$comfyRoot = Join-Path $instBase "ComfyUI" +$py = Join-Path $comfyRoot ".venv\Scripts\python.exe" +$mainPy = Join-Path $comfyRoot "main.py" +$sharedModels = Join-Path $env:LOCALAPPDATA "Comfy-Desktop\ComfyUI-Shared\models" + +if (-not (Test-Path $instBase)) { throw "Comfy Desktop instance not found at: $instBase" } +if (-not (Test-Path $comfyRoot)) { throw "ComfyUI source not found at: $comfyRoot" } +if (-not (Test-Path $py)) { throw "ComfyUI venv python not found: $py" } +if (-not (Test-Path $mainPy)) { throw "ComfyUI main.py not found: $mainPy" } +if (-not (Test-Path $sharedModels)) { throw "Comfy Desktop shared models dir not found: $sharedModels" } + +Write-Host "OK: instance root: $instBase" +Write-Host "OK: ComfyUI source: $comfyRoot" +Write-Host "OK: Python: $py" +Write-Host "OK: main.py: $mainPy" +Write-Host "OK: shared models: $sharedModels" +``` + + + + + +```bash +set -euo pipefail +if [ -d "ComfyUI/.git" ]; then + (cd ComfyUI && git fetch --all && git reset --hard origin/master) +else + git clone https://github.com/Comfy-Org/ComfyUI.git +fi +cd ComfyUI +``` + + + + + +```bash +set -euo pipefail +python -m pip install --upgrade pip +python -m pip install -r ./ComfyUI/requirements.txt +``` + + + + + +```powershell +$comfyRoot = Join-Path $env:LOCALAPPDATA "Comfy-Desktop\ComfyUI-Installs\ComfyUI\ComfyUI" +$py = Join-Path $comfyRoot ".venv\Scripts\python.exe" +$req = Join-Path $comfyRoot "requirements.txt" + +if (-not (Test-Path $py)) { throw "ComfyUI venv python not found: $py" } +if (-not (Test-Path $req)) { throw "ComfyUI requirements.txt not found: $req" } + +& $py -m pip install --upgrade --force-reinstall --no-cache-dir comfyui-frontend-package +if ($LASTEXITCODE -ne 0) { throw "Failed to install comfyui-frontend-package into workspace venv." } + +& $py -c "import importlib.metadata as m; print(m.version('comfyui-frontend-package'))" +if ($LASTEXITCODE -ne 0) { throw "comfyui-frontend-package metadata still missing after install." } +``` + + + + + +```powershell +$py = Join-Path $env:LOCALAPPDATA "Comfy-Desktop\ComfyUI-Installs\ComfyUI\ComfyUI\.venv\Scripts\python.exe" +if (-not (Test-Path $py)) { throw "Missing ComfyUI venv python: $py" } + +& $py -c "import torch; print('torch', torch.__version__); print('cuda_available', torch.cuda.is_available()); print('hip', getattr(torch.version,'hip',None));" +if ($LASTEXITCODE -ne 0) { throw "Torch import/check failed in ComfyUI venv." } +``` + + + + + +```bash +set -euo pipefail + +python - <<'PY' +import torch +print(f"PyTorch version: {torch.__version__}") +print(f"ROCm/HIP version: {getattr(torch.version, 'hip', None)}") +print(f"CUDA/ROCm available: {torch.cuda.is_available()}") +print("PASS: All imports successful") +PY +``` + + + + + +```bash +set -euo pipefail +export LD_LIBRARY_PATH=/opt/rocm/lib:${LD_LIBRARY_PATH:-} +python -c "import torch; print('torch', torch.__version__); print('cuda_available', torch.cuda.is_available()); print('hip', getattr(torch.version,'hip',None));" +``` + + + + + + +```powershell +# The new Comfy Desktop (since June 2026) uses a shared model library separate from the ComfyUI source. +# Models are served from %LOCALAPPDATA%\Comfy-Desktop\ComfyUI-Shared\models\ +# as configured in shared_model_paths.yaml. +$modelsRoot = Join-Path $env:LOCALAPPDATA "Comfy-Desktop\ComfyUI-Shared\models" +if (-not (Test-Path $modelsRoot)) { throw "Comfy Desktop shared models dir not found: $modelsRoot" } + +$cacheDiff = "C:\ModelCache\ComfyUI\models\diffusion_models\z_image_turbo_bf16.safetensors" +$cacheTE = "C:\ModelCache\ComfyUI\models\text_encoders\qwen_3_4b.safetensors" +$cacheVAE = "C:\ModelCache\ComfyUI\models\vae\ae.safetensors" + +if (-not (Test-Path $cacheDiff)) { throw "models missing on runner: $cacheDiff" } +if (-not (Test-Path $cacheTE)) { throw "models missing on runner: $cacheTE" } +if (-not (Test-Path $cacheVAE)) { throw "models missing on runner: $cacheVAE" } + +New-Item -ItemType Directory -Force -Path (Join-Path $modelsRoot "diffusion_models") +New-Item -ItemType Directory -Force -Path (Join-Path $modelsRoot "text_encoders") +New-Item -ItemType Directory -Force -Path (Join-Path $modelsRoot "vae") + +Copy-Item -Force $cacheDiff (Join-Path $modelsRoot "diffusion_models\z_image_turbo_bf16.safetensors") +Copy-Item -Force $cacheTE (Join-Path $modelsRoot "text_encoders\qwen_3_4b.safetensors") +Copy-Item -Force $cacheVAE (Join-Path $modelsRoot "vae\ae.safetensors") + +Write-Host "OK: models copied into $modelsRoot" +``` + + + + + +```bash +cd ComfyUI +cache_diff="/opt/model_cache/ComfyUI/models/diffusion_models/z_image_turbo_bf16.safetensors" +cache_te="/opt/model_cache/ComfyUI/models/text_encoders/qwen_3_4b.safetensors" +cache_vae="/opt/model_cache/ComfyUI/models/vae/ae.safetensors" +test -f "$cache_diff" || (echo "models missing on runner: $cache_diff" && exit 1) +test -f "$cache_te" || (echo "models missing on runner: $cache_te" && exit 1) +test -f "$cache_vae" || (echo "models missing on runner: $cache_vae" && exit 1) +mkdir -p models/diffusion_models models/text_encoders models/vae +cp -f "$cache_diff" models/diffusion_models/z_image_turbo_bf16.safetensors +cp -f "$cache_te" models/text_encoders/qwen_3_4b.safetensors +cp -f "$cache_vae" models/vae/ae.safetensors +``` + + + + + + +```powershell +$comfyRoot = Join-Path $env:LOCALAPPDATA "Comfy-Desktop\ComfyUI-Installs\ComfyUI\ComfyUI" +$py = Join-Path $comfyRoot ".venv\Scripts\python.exe" +$mainPy = Join-Path $comfyRoot "main.py" +$sharedPaths = Join-Path $env:APPDATA "Comfy Desktop\shared_model_paths.yaml" + +$proc = Start-Process -FilePath $py ` + -ArgumentList "`"$mainPy`" --listen 127.0.0.1 --port 8188 --extra-model-paths-config `"$sharedPaths`"" ` + -WorkingDirectory $comfyRoot ` + -NoNewWindow -PassThru + +try { + $ok = $false + for ($i=0; $i -lt 60; $i++) { + $resp = curl.exe -s --max-time 2 http://127.0.0.1:8188/ + if ($LASTEXITCODE -eq 0 -and $resp) { $ok = $true; break } + Start-Sleep -Seconds 1 + } + if (-not $ok) { throw "ComfyUI server not reachable at http://127.0.0.1:8188/" } + Write-Host "OK: ComfyUI server is reachable!" +} finally { + Stop-Process -Id $proc.Id -Force -ErrorAction SilentlyContinue +} +``` + + + + + +```bash +set -euo pipefail +export LD_LIBRARY_PATH=/opt/rocm/lib:${LD_LIBRARY_PATH:-} +python ./ComfyUI/main.py --listen 127.0.0.1 --port 8188 >/tmp/comfyui.log 2>&1 & +PID=$! + +cleanup() { + kill -9 "$PID" >/dev/null 2>&1 || true +} +trap cleanup EXIT + +ok=0 +for i in $(seq 1 60); do + resp="$(curl -s --max-time 2 http://127.0.0.1:8188/ || true)" + if [ -n "$resp" ]; then ok=1; break; fi + sleep 1 +done + +if [ "$ok" -ne 1 ]; then + echo "ComfyUI server not reachable at http://127.0.0.1:8188/" + tail -n 200 /tmp/comfyui.log || true + exit 1 +fi + +echo "OK: ComfyUI server is reachable!" +``` + + + + +## 启动ComfyUI + + + +要在 Windows 上启动 ComfyUI,请点击位于桌面的 ComfyUI 桌面启动器,按照步骤安装带 AMD 的本地版本。 + +

+ ComfyUI Desktop Launcher and Installer +

+ +然后,点击应用顶部中间的 ComfyUI 按钮,这会打开一个设置标签,打开存储标签,并确保路径设置如下,以访问预装的模型。 + +

+ ComfyUI Desktop Menu Storage Tab +

+ + + + + +在 AMD Ryzen™ AI Halo 上,ComfyUI 运行在一个预构建的容器中,无需额外的 Python 设置。 + +要在 Linux 上启动 ComfyUI,请点击任务栏中的 ComfyUI 快捷方式。它应该会自动在浏览器窗口中打开。 +>**提示**:ComfyUI 及其模型存储在 `~/.local/share/ComfyUI/models`。您可以在此处手动添加工作流或新模型。 + + + + + + + +要在 Windows 上启动 ComfyUI,只需点击桌面上的 ComfyUI 快捷方式即可。 + + + + +要启动 ComfyUI: + +1. 确保您位于 ComfyUI 目录中。 +2. 运行 `python3 main.py --use-pytorch-cross-attention` + +ComfyUI 会启动一个本地网络服务器。打开浏览器并访问 `http://127.0.0.1:8188` 以访问该界面。 + +> **提示**:使用 ComfyUI 时请保持终端窗口打开。关闭它将停止服务器运行。 + + + + +## 查找 Z-Image Turbo 模板 + +在生成图像之前,您需要加载 Z-Image Turbo 模板。以下是查找方法: + +1. **查看屏幕最左边缘**——应用最左侧有一个从上到下贯穿的垂直工具栏。 + +2. **找到文件夹图标**——在该左侧工具栏中,寻找一个看起来像文件夹的图标。将鼠标悬停在其上时,会显示标签“模板”。 + +

+ Templates button in the left toolbar +

+ +3. **点击文件夹图标**—这会打开模板面板。 + +4. **搜索“Z-Image Turbo”**——使用搜索栏或浏览可用模板,找到Z-Image Turbo文生图工作流模板,然后点击加载。 + +

+ Selecting the Z-Image Turbo template +

+ +## 下载模型 + + + +## 理解界面 + +当 Z-Image Turbo 模板加载后,您将在画布上看到 2 个主要节点。第一个节点名为“Text to Image (Z-Image-Turbo)”,第二个节点用于查看图像。 + +

+ ComfyUI Main Node +

+ + +在 Z-Image 节点上,点击右上角的按钮以展开该节点并查看子图。 + +

+ ComfyUI Node Subgraph +

+ +### 流程组件 + +Z-Image Turbo 工作流使用四个关键模型组件协同工作: + +| 组件 | 作用 | +|-----------|------| +| **文本编码器**(Qwen 3 4B) | 将您的文本提示转换为扩散模型能够理解的嵌入向量 | +| **扩散模型**(Z-Image Turbo) | 核心神经网络,通过迭代方式将隐空间表示去噪为图像 | +| **VAE**(变分自编码器) | 在图像与隐空间之间进行编码/解码(将最终的隐变量解码为像素) | +| **LoRA**(可选) | 轻量级适配器,可在不重新训练基础模型的情况下修改风格或主体 | + +工作流中的每个节点对应上述其中一个组件。数据从左到右流动:文本 → 嵌入向量 → 引导式去噪 → 隐变量 → 最终图像。 +## 生成您的第一张图像 + +Z-Image Turbo 模型已加载完成。要生成图像: + +1. **输入您的提示词**,在主 Z-Image 节点中。描述要尽量详细。以下是一个示例: + ``` + 一只写实风格的赤狐栖身于积雪林间空地, + 晨光穿透松树枝叶洒落, + 皮毛纹理细腻,背景呈现散景虚化效果 + ``` +2. **(可选)**:确认或调整子图中的任何其他特定设置。 +3. **点击右上角蓝色的“运行工作流”**(或按 `Ctrl+Enter`) +4. 观察各节点在执行每个步骤时高亮显示 + +整个工作流执行过程应在 30 秒内完成。生成的图像会出现在 **图像保存** 节点中,并保存到 `output/` 文件夹。 + + + + +```powershell +$comfyRoot = Join-Path $env:LOCALAPPDATA "Comfy-Desktop\ComfyUI-Installs\ComfyUI\ComfyUI" +$py = Join-Path $comfyRoot ".venv\Scripts\python.exe" +$mainPy = Join-Path $comfyRoot "main.py" +$sharedPaths = Join-Path $env:APPDATA "Comfy Desktop\shared_model_paths.yaml" + +$proc = Start-Process -FilePath $py ` + -ArgumentList "`"$mainPy`" --listen 127.0.0.1 --port 8188 --extra-model-paths-config `"$sharedPaths`"" ` + -WorkingDirectory $comfyRoot ` + -NoNewWindow -PassThru + +try { + $ok = $false + for ($i=0; $i -lt 60; $i++) { + $resp = curl.exe -s --max-time 2 http://127.0.0.1:8188/ + if ($LASTEXITCODE -eq 0 -and $resp) { $ok = $true; break } + Start-Sleep -Seconds 1 + } + if (-not $ok) { throw "ComfyUI server not ready on http://127.0.0.1:8188/" } + + # run submit script from assets working dir (where image_z_image_turbo.json should exist) + @' +import json, time, urllib.request, urllib.error, sys, os +wf_path = "image_z_image_turbo.json" +if not os.path.exists(wf_path): + raise SystemExit(f"Missing workflow json in working dir: {os.getcwd()} -> {wf_path}") +with open(wf_path, "r", encoding="utf-8") as f: + workflow = json.load(f) +data = json.dumps({"prompt": workflow}).encode("utf-8") +req = urllib.request.Request( + "http://127.0.0.1:8188/prompt", + data=data, + headers={"Content-Type":"application/json"}, + method="POST", +) +try: + with urllib.request.urlopen(req, timeout=60) as r: + prompt_id = json.load(r)["prompt_id"] +except urllib.error.HTTPError as e: + body = e.read().decode("utf-8", "replace") + print("HTTPError", e.code, e.reason) + print(body) + sys.exit(1) +except Exception as e: + print("Request failed:", repr(e)) + sys.exit(1) + +for _ in range(600): + with urllib.request.urlopen(f"http://127.0.0.1:8188/history/{prompt_id}", timeout=60) as r: + hist = json.load(r) + entry = hist.get(prompt_id, {}) + if entry.get("outputs"): + print("OK, output image generated!") + sys.exit(0) + time.sleep(1) + +print("No outputs after waiting.") +sys.exit(1) +'@ | & $py - + if ($LASTEXITCODE -ne 0) { throw "Workflow submit/generation failed" } + +} finally { + Stop-Process -Id $proc.Id -Force -ErrorAction SilentlyContinue +} +``` + + + + + + +```bash +set -euo pipefail +export LD_LIBRARY_PATH=/opt/rocm/lib:${LD_LIBRARY_PATH:-} +# start server +python ./ComfyUI/main.py --listen 127.0.0.1 --port 8188 >/tmp/comfyui.log 2>&1 & +PID=$! + +cleanup() { + kill -9 "$PID" >/dev/null 2>&1 || true +} +trap cleanup EXIT + +# wait ready +ok=0 +for i in $(seq 1 60); do + resp="$(curl -s --max-time 2 http://127.0.0.1:8188/ || true)" + if [ -n "$resp" ]; then ok=1; break; fi + sleep 1 +done + +if [ "$ok" -ne 1 ]; then + echo "ComfyUI server not ready" + tail -n 200 /tmp/comfyui.log || true + exit 1 +fi + +# submit workflow json from assets folder (one level up from ComfyUI) +python - <<'PY' +import json, time, urllib.request, urllib.error, sys, os + +wf_path = "image_z_image_turbo.json" +if not os.path.exists(wf_path): + raise SystemExit(f"Missing workflow json in working dir: {os.getcwd()} -> {wf_path}") + +with open(wf_path, "r", encoding="utf-8") as f: + workflow = json.load(f) + +data = json.dumps({"prompt": workflow}).encode("utf-8") +req = urllib.request.Request( + "http://127.0.0.1:8188/prompt", + data=data, + headers={"Content-Type":"application/json"}, + method="POST", +) + +try: + with urllib.request.urlopen(req, timeout=60) as r: + prompt_id = json.load(r)["prompt_id"] +except urllib.error.HTTPError as e: + body = e.read().decode("utf-8", "replace") + print("HTTPError", e.code, e.reason) + print(body) + sys.exit(1) + +for _ in range(600): + with urllib.request.urlopen(f"http://127.0.0.1:8188/history/{prompt_id}", timeout=60) as r: + hist = json.load(r) + entry = hist.get(prompt_id, {}) + if entry.get("outputs"): + print("OK, output image generated!") + sys.exit(0) + time.sleep(1) + +print("No outputs after waiting.") +sys.exit(1) +PY +``` + + + + + + +```powershell +$outDir = Join-Path $env:LOCALAPPDATA "Comfy-Desktop\ComfyUI-Installs\ComfyUI\ComfyUI\output" + +# ComfyUI saves into date-stamped subdirectories, so recurse to find PNGs +$files = Get-ChildItem -Path $outDir -Filter *.png -File -Recurse -ErrorAction SilentlyContinue +if (-not $files) { + throw "No PNG files found under: $outDir" +} +$files | Sort-Object LastWriteTime -Descending | Select-Object -First 5 | ForEach-Object { $_.FullName } +``` + + + + + +```bash +set -euo pipefail +ls -1 ComfyUI/output/*.png >/dev/null 2>&1 || (echo "No PNG files found in ComfyUI/output" && exit 1) +ls -1t ComfyUI/output/*.png | head -n 5 +``` + + + + +## 调整生成参数 + +### KSampler 设置 + +KSampler 节点控制核心的扩散过程: + +| 参数 | 控制内容 | Z-Image Turbo 推荐值 | +|-----------|------------------|-------------------------------| +| **steps** | 去噪迭代的次数 | 4–10(turbo 模型经过蒸馏,所需步数较少) | +| **cfg** | 无分类器引导系数——即多大程度上严格遵循提示词 | 1.0–2.0(turbo 模型使用非常低的引导强度) | +| **sampler_name** | 去噪算法 | `euler` 和 `res_multistep` 对 turbo 模型效果较好 | +| **scheduler** | 噪声调度曲线 | `normal` 或 `simple` | +| **seed** | 用于结果可复现的随机种子 | 设置固定值以便在某个构图基础上迭代 | + +### 图像尺寸 + +要调整输出尺寸,找到 **Empty Latent Image** 节点并修改 **width** 和 **height**。为获得最佳质量,请将最长边保持在 1024 像素以内。 + +### ModelSamplingAuraFlow + +**ModelSamplingAuraFlow** 节点是一个专用的采样修饰器,用于调整扩散过程处理噪声调度的方式。在 Z-Image Turbo 工作流中,您会看到该节点连接到模型输出端。 + +| 参数 | 控制内容 | 推荐值 | +|-----------|------------------|-------------------| +| **shift** | 调整噪声调度的时序——数值越高,将更多细节优化推迟到后面的步骤 | 1.0–4.0(默认值为 3.0) | + +何时调整 **shift**: + +- **较低值(1.0–2.0)**:收敛更快,适合简单构图 +- **较高值(3.0–4.0)**:优化更渐进,可在复杂场景中改善细节表现 + +AuraFlow 采样方法专为像 Z-Image Turbo 这样的流匹配(flow-matching)模型设计,确保在整个生成过程中噪声分布合理。 + +## 使用工作流 + +### 保存工作流 + +点击菜单中的 **Save** 按钮,将您的工作流导出为 JSON 文件。这会保存以下内容: + +- 所有节点及其参数 +- 节点之间的所有连接 +- 当前的提示词文本 + +### 加载工作流 + +将工作流 JSON 文件拖放到画布上,或使用菜单中的 **Load**。默认显示的 Z-Image Turbo 工作流即是从已保存的工作流文件加载而来。 + +### 分享工作流 + +工作流是自包含的——将 JSON 文件分享给同事,他们即可重现您的完全相同的设置。这使得 ComfyUI 非常适合协作实验。 + +## 后续步骤 + +- **探索 LoRA 节点**:无需重新训练即可应用风格或主体适配器 +- **添加负向提示词**:将第二个 CLIP Text Encode 节点连接到 KSampler 的 **negative** 条件输入端,引导模型避开模糊、伪影或水印等不需要的特征 +- **构建自定义工作流**:串联多次生成、添加放大处理,或创建图像变体 +- **浏览社区工作流**:[ComfyUI 示例](https://github.com/comfyanonymous/ComfyUI_examples)提供了许多可直接使用的工作流 + +ComfyUI 的优势在于实验:以不同方式连接节点、调整参数,并观察每次改动如何影响输出结果。这种动手实践的探索方式有助于建立对扩散模型工作原理的直观理解。 + +如需了解更多信息,请查阅 [ComfyUI 文档](https://docs.comfy.org/)。 \ No newline at end of file diff --git a/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/cover.jpeg b/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/cover.jpeg new file mode 100644 index 00000000..d9901232 Binary files /dev/null and b/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/cover.jpeg differ diff --git a/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/models_storage.png b/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/models_storage.png new file mode 100644 index 00000000..96c9d540 Binary files /dev/null and b/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/models_storage.png differ diff --git a/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/new_installer.png b/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/new_installer.png new file mode 100644 index 00000000..a118e445 Binary files /dev/null and b/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/new_installer.png differ diff --git a/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/select-template.png b/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/select-template.png new file mode 100644 index 00000000..633e977c Binary files /dev/null and b/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/select-template.png differ diff --git a/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/subgraph_good.png b/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/subgraph_good.png new file mode 100644 index 00000000..d02ded31 Binary files /dev/null and b/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/subgraph_good.png differ diff --git a/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/templates.png b/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/templates.png new file mode 100644 index 00000000..d390b1a0 Binary files /dev/null and b/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/templates.png differ diff --git a/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/zimagenode.png b/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/zimagenode.png new file mode 100644 index 00000000..062cfc01 Binary files /dev/null and b/localized-playbooks/zh-CN/core/comfyui-image-gen/assets/zimagenode.png differ diff --git a/localized-playbooks/zh-CN/core/comfyui-image-gen/platform.md b/localized-playbooks/zh-CN/core/comfyui-image-gen/platform.md new file mode 100644 index 00000000..241af64b --- /dev/null +++ b/localized-playbooks/zh-CN/core/comfyui-image-gen/platform.md @@ -0,0 +1,27 @@ + + +# 平台配置 + +本文档描述了运行此工作手册所需的预期平台配置。 + +## 必需的应用程序/框架 +### Windows/Linux + +应按照[ComfyUI 安装指南](../../dependencies/comfyui.md)中提供的说明预先安装 ComfyUI。 + +## 必需的模型 + +### Windows/Linux + +以下模型必须存在于安装 ComfyUI 的目录下的 `models` 文件夹中。 + +| 模型类型 | 文件名 | 大小 | 位置 | 下载 | +|------------|----------|------|----------|----------| +| 文本编码器 | `qwen_3_4b.safetensors` | 7.49 GB | `models/text_encoders/` | [链接](https://huggingface.co/Comfy-Org/z_image_turbo/resolve/main/split_files/text_encoders/qwen_3_4b.safetensors) | +| LoRA | `pixel_art_style_z_image_turbo.safetensors` | 162.25 MB | `models/loras/` | [链接](https://huggingface.co/tarn59/pixel_art_style_lora_z_image_turbo/resolve/main/pixel_art_style_z_image_turbo.safetensors) | +| 扩散模型 | `z_image_turbo_bf16.safetensors` | 11.46 GB | `models/diffusion_models/` | [链接](https://huggingface.co/Comfy-Org/z_image_turbo/resolve/main/split_files/diffusion_models/z_image_turbo_bf16.safetensors) | +| VAE | `ae.safetensors` | 319.77 MB | `models/vae/` | [链接](https://huggingface.co/Comfy-Org/z_image_turbo/resolve/main/split_files/vae/ae.safetensors) | diff --git a/localized-playbooks/zh-CN/core/comfyui-image-gen/playbook.json b/localized-playbooks/zh-CN/core/comfyui-image-gen/playbook.json new file mode 100644 index 00000000..c3d91a36 --- /dev/null +++ b/localized-playbooks/zh-CN/core/comfyui-image-gen/playbook.json @@ -0,0 +1,17 @@ +{ + "id": "comfyui-image-gen", + "title": "使用 ComfyUI 和 Z Image Turbo 生成图像", + "description": "使用 ComfyUI 结合 Z Image Turbo 创建令人惊艳的 AI 生成图像。", + "tested_platforms": { + "halo": [ + "windows", + "linux" + ] + }, + "required_platforms": { + "halo": [ + "windows", + "linux" + ] + } +} diff --git a/localized-playbooks/zh-CN/dependencies/assets/comfy_download.png b/localized-playbooks/zh-CN/dependencies/assets/comfy_download.png new file mode 100644 index 00000000..3a2b59a2 Binary files /dev/null and b/localized-playbooks/zh-CN/dependencies/assets/comfy_download.png differ diff --git a/localized-playbooks/zh-CN/dependencies/assets/memory-config/adrenalin_vram_new.png b/localized-playbooks/zh-CN/dependencies/assets/memory-config/adrenalin_vram_new.png new file mode 100644 index 00000000..2f1f055e Binary files /dev/null and b/localized-playbooks/zh-CN/dependencies/assets/memory-config/adrenalin_vram_new.png differ diff --git a/localized-playbooks/zh-CN/dependencies/assets/memory-config/linux_mem_new.png b/localized-playbooks/zh-CN/dependencies/assets/memory-config/linux_mem_new.png new file mode 100644 index 00000000..e8714786 Binary files /dev/null and b/localized-playbooks/zh-CN/dependencies/assets/memory-config/linux_mem_new.png differ diff --git a/localized-playbooks/zh-CN/dependencies/assets/software-update/linux.png b/localized-playbooks/zh-CN/dependencies/assets/software-update/linux.png new file mode 100644 index 00000000..99ea1465 Binary files /dev/null and b/localized-playbooks/zh-CN/dependencies/assets/software-update/linux.png differ diff --git a/localized-playbooks/zh-CN/dependencies/assets/software-update/windows.png b/localized-playbooks/zh-CN/dependencies/assets/software-update/windows.png new file mode 100644 index 00000000..81b1f0b7 Binary files /dev/null and b/localized-playbooks/zh-CN/dependencies/assets/software-update/windows.png differ diff --git a/localized-playbooks/zh-CN/dependencies/comfyui.md b/localized-playbooks/zh-CN/dependencies/comfyui.md new file mode 100644 index 00000000..2ad6df4c --- /dev/null +++ b/localized-playbooks/zh-CN/dependencies/comfyui.md @@ -0,0 +1,40 @@ + + +### ComfyUI + + + +1. 从[download.comfy.org](https://download.comfy.org/windows/nsis/x64)下载最新的 Windows ComfyUI 安装程序。 +2. 选择您的硬件配置:选择 `AMD ROCm`。 +3. 选择 ComfyUI 的安装位置:使用默认路径或您偏好的文件夹。 +4. 桌面应用设置:我们建议取消勾选"自动更新",以确保您使用的是此应用推荐的版本。 +5. 按"下一步"开始安装。 + + + + +#### 克隆 ComfyUI +```bash +git clone https://github.com/Comfy-Org/ComfyUI.git +``` + +#### (可选)检出特定版本 +```bash +git checkout v0.19.2 +``` + +#### 安装 ComfyUI 依赖项 + +激活 Python 虚拟环境后,运行: +```bash +cd ComfyUI +pip install -r requirements.txt +``` + +> **注意**:更多信息请参阅 [ComfyUI GitHub](https://github.com/comfy-org/ComfyUI)。 + + diff --git a/localized-playbooks/zh-CN/dependencies/comfyui_models.md b/localized-playbooks/zh-CN/dependencies/comfyui_models.md new file mode 100644 index 00000000..4324b423 --- /dev/null +++ b/localized-playbooks/zh-CN/dependencies/comfyui_models.md @@ -0,0 +1,13 @@ + + +### ComfyUI 模型 + +如果您之前删除了预先下载的 ComfyUI 模型,或者想首次下载这些模型,只需在系统提示检测到缺失模型时,点击每个模型对应的 `下载` 按钮即可。 +您可能需要手动将模型文件放置到正确的位置。 + +

+ ComfyUI Download Models \ No newline at end of file diff --git a/localized-playbooks/zh-CN/dependencies/driver.md b/localized-playbooks/zh-CN/dependencies/driver.md new file mode 100644 index 00000000..50342c61 --- /dev/null +++ b/localized-playbooks/zh-CN/dependencies/driver.md @@ -0,0 +1,32 @@ + + + + +### AMD GPU 驱动程序 + +使用 [`AMD Software: Adrenalin Edition™`](https://www.amd.com/zh-cn/products/software/adrenalin.html) 更新到最新的 AMD GPU 驱动程序。 + +1. 从开始菜单或系统托盘打开 `AMD Software: Adrenalin Edition`。 +2. 导航到**驱动程序和软件**,点击**管理更新**。 +3. 如果有可用的更新,请按照提示下载并安装。 + + +```powershell +Get-CimInstance Win32_VideoController | Select-Object Name, DriverVersion +``` + + + + + + +### AMD GPU 驱动程序 + +使用适用于 Linux 的 Radeon 软件(RSL)流程安装 AMD GPU 驱动程序(amdgpu)。有关适用于您所使用发行版的说明,请参阅[安装内核驱动程序](https://rocm.docs.amd.com/en/7.13.0-preview/install/rocm.html)。 + + + diff --git a/localized-playbooks/zh-CN/dependencies/memoryconfig.md b/localized-playbooks/zh-CN/dependencies/memoryconfig.md new file mode 100644 index 00000000..07428f11 --- /dev/null +++ b/localized-playbooks/zh-CN/dependencies/memoryconfig.md @@ -0,0 +1,79 @@ + + + + + + +对于 Ryzen AI Halo,专用 GPU 内存默认为 64GB,这对大多数工作负载来说已经足够。对于更大的模型或更长的上下文,将其增加到 96GB 可能会有所帮助。要进行调整,请打开 **AMD Software: Adrenalin Edition™** ,并导航到 **【性能】 → 【调整】 → 【AMD 可变显示卡内存】**。重启后更改才会生效。 + +

+ AMD Software Adrenalin Edition — AMD Variable Graphics Memory panel +

+ + + + + +要更改专用 GPU 内存值,请打开 **AMD Software: Adrenalin Edition™** ,并导航到 **【性能】 → 【调整】 → 【AMD 可变显示卡内存】**。重启后更改才会生效。 + +

+ AMD Software Adrenalin Edition — AMD Variable Graphics Memory panel +

+ + + + + + + +在 Linux 上,要运行更大的模型,请增加 GPU 可用的**共享内存**池。这可能需要将 BIOS 中的专用 GPU 内存设置为最小值,以便最大化共享内存池。 + + + +对于 AMD Ryzen™ AI Halo,默认为 96GB 共享内存。要修改此设置,请打开 **AMD Ryzen™ AI Developer Center**,然后转到**设置(Settings)**选项卡。在**图形性能设置(Graphics Performance Settings)**下,增加**共享视频内存(Shared Video Memory)**滑块,然后单击**应用更改(Apply Changes)**,并重启以使更改生效。 + +

+ AMD Ryzen AI Developer Center — Graphics Performance Settings with Shared Video Memory slider +

+ + + + + +通过更改内核的转换表管理器(Translation Table Manager,TTM)页面设置来增加共享内存池。AMD 建议在 BIOS 中将最小专用 VRAM 设置为(0.5 GB),以便最大数量可用作共享内存。 + +1. 安装 `pipx` 工具,并将 pipx 安装的 wheel 的路径添加到系统搜索路径中: + + ```bash + sudo apt install pipx + pipx ensurepath + ``` + +2. 从 PyPI 安装 `amd-debug-tools` wheel: + + ```bash + pipx install amd-debug-tools + ``` + +3. 查询当前的共享内存设置: + + ```bash + amd-ttm + ``` + +4. 增加共享内存分配(单位为 GB): + + ```bash + amd-ttm --set + ``` + +5. 重启后更改才会生效。 + + + + + diff --git a/localized-playbooks/zh-CN/dependencies/softwareupdate.md b/localized-playbooks/zh-CN/dependencies/softwareupdate.md new file mode 100644 index 00000000..20b02ade --- /dev/null +++ b/localized-playbooks/zh-CN/dependencies/softwareupdate.md @@ -0,0 +1,32 @@ + + + + +在开始之前,请确保您的 Ryzen AI Halo 已安装最新软件。打开 **AMD Ryzen™ AI Developer Center**,检查应用本身以及其他软件是否有可用更新。 + + + +切换至 **【更新】** 选项卡,如果有可用更新,请安装并重启后再继续。 + + +

+ AMD Ryzen AI Developer Center — Updates tab on Windows +

+ + + + + +进入 **Manage** 选项卡。如果有可用更新,请安装并重启后再继续。 + +

+ AMD Ryzen AI Developer Center — Manage tab on Linux +

+ + + +