--- license: other license_name: nsclv1 license_link: LICENSE base_model: - nvidia/PiD - yilwang/PiD-QDM-Halo2-4K library_name: pytorch pipeline_tag: image-to-image tags: - pixel-diffusion-decoder - super-resolution --- # PiD-EfficientGen PiD Hybrid replaces attention in the 14 PixelDiT patch blocks with sliding-window attention and quadrant delta memory (QDM). The native PiT pixel blocks are retained. These decoders map a low-resolution latent to an RGB image at four times its width and height. The release contains two decoder packages and three example text-to-image configurations that supply the latent with Z-Image-Turbo. | Configuration | Decoder package | Sampler | Steps | CFG | QDM write stride | | --- | --- | --- | ---: | ---: | ---: | | `configs/pid-hybrid.yaml` | `pid_hybrid-vdn-7629-2026-11-12` | Flow DPMS multistep | 25 | 5 | 1 | | `configs/pid-hybrid-dmd2.yaml` | `pid_hybrid-dmd2-4000-2026-11-23` | DMD2 SDE | 4 | 1 | 1 | | `configs/pid-hybrid-dmd2-sparse.yaml` | `pid_hybrid-dmd2-4000-2026-11-23` | DMD2 SDE | 4 | 1 | 2 | The VDN adapter continues the Halo2 stage-B checkpoint with sliding-window attention and requires the official PiD v1.5 FLUX undistilled checkpoint. The complete DMD2 student was initialized from VDN step 7,629 and distilled using the undistilled PiD teacher. Its four updates use `[0.999, 0.866, 0.634, 0.342, 0.0]`. The sparse YAML uses the same student weights and writes every other patch column while keeping the K/V convolution. Each package directory contains `config.json` and `model.pt` and must retain its name. ## Run an example Install the PiD-EfficientGen runtime with Conda and run the commands from its repository root. The examples require one BF16-capable CUDA GPU with sufficient memory for 4K decoding. Accept Gemma's terms on the Hub and authenticate with `hf auth login` before staging the external assets. [Runtime source and installation guide](https://github.com/gcy-hub/PiD-EfficientGen/tree/61fe9001e21e9c1995a1a814db83f32ca42f2c19) ```bash git clone https://github.com/gcy-hub/PiD-EfficientGen.git cd PiD-EfficientGen git checkout 61fe9001e21e9c1995a1a814db83f32ca42f2c19 conda env create -f environment.yml conda activate pid-efficientgen python -m pip install -e . hf auth login export PID_EFFICIENTGEN_ASSETS=assets python scripts/download.py models pid gemma zimage --dest "$PID_EFFICIENTGEN_ASSETS" env -u http_proxy -u https_proxy -u all_proxy -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY \ -u no_proxy -u NO_PROXY HF_ENDPOINT=https://huggingface.co HF_HUB_DISABLE_XET=1 \ hf download ChangyiGan/PiD-EfficientGen --local-dir "$PID_EFFICIENTGEN_ASSETS/packages" scripts/infer.sh "$PID_EFFICIENTGEN_ASSETS/packages/configs/pid-hybrid.yaml" scripts/infer.sh "$PID_EFFICIENTGEN_ASSETS/packages/configs/pid-hybrid-dmd2.yaml" scripts/infer.sh "$PID_EFFICIENTGEN_ASSETS/packages/configs/pid-hybrid-dmd2-sparse.yaml" ``` The configs resolve resource paths from the current working directory. `PID_EFFICIENTGEN_ASSETS` defaults to `assets` and may point to an existing local asset root. Under it, keep the packages in `packages/`, Gemma in `gemma-2-2b-it/`, and Z-Image-Turbo in `Z-Image-Turbo/`. The VDN YAML also expects `PiD/checkpoints/PiD_v1pt5_res2kto4k_sr4x_official_flux_undistilled/model_ema_bf16.pth`. A DMD2-only setup needs only `gemma zimage` in the asset staging command. Missing assets cause an explicit error. Each command writes a PNG, `metadata.json` and `generation.log` to `outputs/experiments//inference//`. Edit the prompt and seed to generate a different sample. For a smaller check, set both output axes to 1024. Set a fresh `paths.experiments` before repeating an example because existing result directories are protected. ## Lineage and license The VDN and DMD2 weights are derivative works of NVIDIA PiD and PiD-QDM Halo2. They are distributed under NVIDIA NSCLv1 for **non-commercial research or evaluation only**. The complete license and source notices accompany both packages. Gemma and Z-Image-Turbo have their own terms. [License](LICENSE) ยท [Notices and upstream revisions](NOTICE.md)