Extensions/ComfyUI-PS-SR-WSL
ComfyUI Extension

ComfyUI-PS-SR-WSL

Run HiDream PS-SR as an isolated WSL post-processing node for ComfyUI videos

By Jarcis-cy·Created 17 days ago·Updated 17 days ago· 0
Jarcis-cy/ComfyUI-PS-SR-WSL
Nodes1
On cloudLocal install
Categoryvideo/PS-SR WSL
Stars0
Updated17 days ago
Readme

ComfyUI-PS-SR-WSL

A Windows + WSL ComfyUI output node for HiDream-ai/PS-SR. It restores a saved video file in an isolated WSL Python 3.10 environment instead of loading the PS-SR dependency stack or a full high-resolution frame batch into ComfyUI.

This is an independent integration, not an official HiDream-ai project. It does not include or download PS-SR source code, checkpoints, or dependent model weights.

What it does

PSSRVideoRestoreWSL accepts VHS_FILENAMES from Video Helper Suite's Video Combine node:

  1. Saves and validates the native source video first.
  2. Builds an even-sized target grid with Lanczos.
  3. Unloads ComfyUI models and runs PS-SR Step 1 and Step 2 in WSL.
  4. Copies the original audio stream without re-encoding or -shortest.
  5. Rejects the result unless dimensions, frame count, FPS, per-frame timestamps, audio hash, muxed video hash, and full decode all pass.

The base and draft pipelines keep independent DiTs while sharing identical read-only T5, VAE, and RAM model instances. Hugging Face and Transformers are forced offline during inference after local runtime validation.

Requirements

  • Windows 10/11 with WSL 2 and an NVIDIA GPU available inside WSL.
  • ComfyUI with ComfyUI-VideoHelperSuite.
  • ffmpeg, ffprobe, and wsl.exe available on the Windows PATH.
  • The official HiDream-ai/PS-SR repository on a local Windows drive.
  • A WSL Python 3.10 environment containing the official PS-SR dependencies.
  • Official PS-SR checkpoints and dependent models in the upstream folder layout.

Follow the upstream PS-SR installation guide for CUDA, Python packages, checkpoints, and model files. This repository deliberately does not automate or redistribute those downloads.

Install

Clone this repository into ComfyUI/custom_nodes:

cd C:\path\to\ComfyUI\custom_nodes
git clone https://github.com/Jarcis-cy/ComfyUI-PS-SR-WSL.git
cd ComfyUI-PS-SR-WSL
Copy-Item config.example.json config.json

Edit config.json:

{
  "ps_sr_root": "C:/AI/PS-SR",
  "wsl_distro": "Ubuntu",
  "python_path": "/home/your-user/.venvs/ps-sr/bin/python"
}
  • ps_sr_root is the Windows path to the official PS-SR checkout. It must be on a drive mounted by WSL, such as /mnt/c.
  • wsl_distro is the distribution name shown by wsl.exe -l -q.
  • python_path is the Python executable or command inside that distribution.

The environment variables PSSR_ROOT, PSSR_WSL_DISTRO, and PSSR_PYTHON override the file values. config.json is ignored by Git and is read for every execution, so configuration changes do not require another ComfyUI restart.

Restart ComfyUI after installing the node.

Use

Connect the Filenames output of VHS_VideoCombine to PS-SR WSL Video Restore:

frames + audio -> VHS Video Combine -> PS-SR WSL Video Restore

The native MP4 remains available even if PS-SR is disabled or fails. Use enabled=0 for a zero-cost bypass. scale_multiplier defines the Lanczos target grid before restoration; 1.5 is the validated setting. keep_intermediates retains Step 1 and Step 2 videos for diagnosis.

A minimal three-node workflow is available at examples/vhs-pssr-postprocess.json. Upload a short video, set the Video Combine frame rate to the source rate, and queue the workflow.

Only one PS-SR job may run in a ComfyUI process at a time. ComfyUI cancellation terminates the WSL process tree. Logs and manifest.json are written under pssr_jobs/ next to the native output; intermediate videos are removed after success unless requested.

Validated path

The first release was validated with ComfyUI 0.30.0, frontend 1.47.12, Video Helper Suite 1.7.9, Ubuntu WSL, and the upstream PS-SR runtime at commit 1d46e0696c3e30da125d33d34b339c767a984ffa.

A 704x1280 H.264 source containing 77 frames at 30 FPS was restored on a 1.5x grid to 1056x1920. All 77 timestamps matched, the original AAC stream hash matched, the Step 2 and final muxed video stream hashes matched, and a full FFmpeg decode passed. Other dimensions and scales should be treated as experimental.

Scope and limitations

  • Windows + WSL only.
  • Input must come from Video Helper Suite and resolve inside the ComfyUI output directory.
  • The PS-SR checkout must currently be on a Windows-mounted local drive.
  • This node is file-based whole-video post-processing; it is intentionally not placed inside a frame loop.
  • Peak VRAM and runtime are governed mainly by PS-SR and the selected target grid.

License and attribution

This integration is licensed under Apache-2.0. See LICENSE and NOTICE.

PS-SR is developed by HiDream-ai and distributed under Apache-2.0. If you use the restoration model in research, cite the paper listed in the official PS-SR repository.