From 233d42653f65c421452566d74868e823af39096d Mon Sep 17 00:00:00 2001 From: lin-bot23 Date: Wed, 22 Jul 2026 13:46:44 +0800 Subject: [PATCH] fix: clean up PiD latent upscale tutorial for PR #1069 - Fix sample output image URL (use utility_pid_latent_upscale_dit-2.webp instead of nonexistent .png) - Add missing gemma_2_2b_it_elm_fp8_scaled.safetensors (PiD subgraph CLIPLoader text encoder) - Remove ja/zh/ko translation files and all localized docs.json entries - Replace all em dashes with periods and colons - Rebase from upstream/main --- docs.json | 1 + .../pid-latent-upscale/pid-latent-upscale.mdx | 112 ++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 tutorials/utility/pid-latent-upscale/pid-latent-upscale.mdx diff --git a/docs.json b/docs.json index 3457c18be..08c8dabe9 100644 --- a/docs.json +++ b/docs.json @@ -395,6 +395,7 @@ "tutorials/utility/remove-background-birefnet", "tutorials/utility/pose-detection-sdpose", "tutorials/utility/moge", + "tutorials/utility/pid-latent-upscale/pid-latent-upscale", "tutorials/utility/depth-anything-3", { "group": "Face Detection", diff --git a/tutorials/utility/pid-latent-upscale/pid-latent-upscale.mdx b/tutorials/utility/pid-latent-upscale/pid-latent-upscale.mdx new file mode 100644 index 000000000..9fde54cf8 --- /dev/null +++ b/tutorials/utility/pid-latent-upscale/pid-latent-upscale.mdx @@ -0,0 +1,112 @@ +--- +title: "PiD Latent Upscale ComfyUI Workflow Example" +description: "PiD (Pixel Diffusion Decoder) turns a diffusion latent into a 4x super-resolved image in 4 distilled pixel-space steps. No separate VAE decode needed." +sidebarTitle: "PiD Latent Upscale" +--- + +import UpdateReminder from '/snippets/tutorials/update-reminder.mdx' + +**PiD (Pixel Diffusion Decoder)** turns a diffusion **latent** into a **4x super-resolved image** in 4 distilled pixel-space steps. No separate VAE decode needed. This workflow demonstrates using PiD to upscale a Z-Image-Turbo latent from **1024px to 4096px**. + +**Related Links**: +- [Comfy-Org/PixelDiT on Hugging Face](https://huggingface.co/Comfy-Org/PixelDiT) +- [nvidia/PixelDiT-1300M-1024px (official release)](https://huggingface.co/nvidia/PixelDiT-1300M-1024px) + +PiD Latent Upscale workflow + + + + + + Download JSON or search "PiD Latent Upscale" in Template Library + + + +## How PiD works + +PiD matches checkpoints by the **VAE / latent space** of the upstream model (the encoder side), not the diffusion model name alone. You need to select the PiD checkpoint that corresponds to the latent space of the model used for initial generation. + +This workflow uses **Z-Image-Turbo** (1024px latent to 4096px output) which shares Flux.1's 16-ch VAE. + + + This workflow uses Subgraph nodes for modular processing. Check out the Subgraph documentation to learn how to customize and extend the workflow. + + +### Available PiD checkpoints + +All checkpoints are downloaded from [Comfy-Org/PixelDiT](https://huggingface.co/Comfy-Org/PixelDiT) to `models/diffusion_models/`. + +| Checkpoint | Input to Output | Compatible latent (VAE backbone) | +|---|---|---| +| [`pid_flux1_512_to_2048_4step_bf16`](https://huggingface.co/Comfy-Org/PixelDiT/resolve/main/diffusion_models/pid_flux1_512_to_2048_4step_bf16.safetensors) | 512 to 2048 | Flux1-dev 16-ch VAE (Flux.1, Z-Image) | +| [`pid_flux1_1024_to_4096_4step_bf16`](https://huggingface.co/Comfy-Org/PixelDiT/resolve/main/diffusion_models/pid_flux1_1024_to_4096_4step_bf16.safetensors) | 1024 to 4096 | Flux1-dev 16-ch VAE (Flux.1, Z-Image) **(this workflow)** | +| [`pid_flux2_512_to_2048_4step_bf16`](https://huggingface.co/Comfy-Org/PixelDiT/resolve/main/diffusion_models/pid_flux2_512_to_2048_4step_bf16.safetensors) | 512 to 2048 | Flux2-dev 128-ch VAE (Flux.2) | +| [`pid_flux2_1024_to_4096_4step_bf16`](https://huggingface.co/Comfy-Org/PixelDiT/resolve/main/diffusion_models/pid_flux2_1024_to_4096_4step_bf16.safetensors) | 1024 to 4096 | Flux2-dev 128-ch VAE (Flux.2) | +| [`pid_sd3_512_to_2048_4step_bf16`](https://huggingface.co/Comfy-Org/PixelDiT/resolve/main/diffusion_models/pid_sd3_512_to_2048_4step_bf16.safetensors) | 512 to 2048 | SD3 medium 16-ch VAE | +| [`pid_sd3_1024_to_4096_4step_bf16`](https://huggingface.co/Comfy-Org/PixelDiT/resolve/main/diffusion_models/pid_sd3_1024_to_4096_4step_bf16.safetensors) | 1024 to 4096 | SD3 medium 16-ch VAE | + +### Subgraph settings + +Configure these on the **Latent Upscale Decode (PiD)** subgraph: + +| Setting | Value | Description | +|---|---|---| +| `latent_format` | `flux` | `flux` for Flux.1/Flux.2/Z-Image, `sd3` for SD3 (Flux.2 is auto-detected by 128 channels) | +| `degrade_sigma` | `0.0` | How "finished" the input latent is. `0.0` for fully denoised (default), `0.1–0.8` for partially denoised, `1.0` for pure noise | + +### Steps to run + +1. **Generate a latent**. Use a T2I workflow (e.g., Z-Image-Turbo) to produce a latent image. +2. **Connect to PiD**. Feed the latent into the **Latent Upscale Decode (PiD)** subgraph node. +3. **Select checkpoint**. Choose the PiD checkpoint matching your upstream model's VAE latent space. +4. **Set output size**. Set PiD output size to **4x** the input latent resolution. +5. **Run**. The subgraph decodes and upscales in a single 4-step pass. + +## Model downloads + +PiD is part of the PixelDiT model family. This workflow also requires the Z-Image-Turbo model for initial generation. + + + + pid_flux1_1024_to_4096_4step_bf16.safetensors: PiD checkpoint for Flux.1 / Z-Image latent space + + + z_image_turbo_bf16.safetensors: used for initial generation before PiD upscale + + + + + + qwen_3_4b.safetensors: text encoder for Z-Image-Turbo + + + ae.safetensors: VAE for Z-Image-Turbo + + + + + + gemma_2_2b_it_elm_fp8_scaled.safetensors: text encoder for PiD subgraph CLIPLoader (type: pixeldit) + + + +> PiD uses a built-in **pixel_space** VAE. No separate VAE file is needed for PiD itself. + +### Model storage location + +``` +📂 ComfyUI/ +├── 📂 models/ +│ ├── 📂 text_encoders/ +│ │ ├── qwen_3_4b.safetensors +│ │ └── gemma_2_2b_it_elm_fp8_scaled.safetensors +│ ├── 📂 diffusion_models/ +│ │ ├── pid_flux1_1024_to_4096_4step_bf16.safetensors +│ │ └── z_image_turbo_bf16.safetensors +│ └── 📂 vae/ +│ └── ae.safetensors +``` + +### Sample output + +PiD sample output