[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-110797":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":32,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":15,"starSnapshotCount":15,"syncStatus":36,"lastSyncTime":37,"discoverSource":38},110797,"ComfyUI-PhotoDeblur","porfeng\u002FComfyUI-PhotoDeblur","porfeng","Photo deblurring for ComfyUI with HI-Diff and MISCFilter. comfy ui节点以及工作流支持手抖与运动模糊修复、原尺寸分块处理及模型下载。","",null,"Python",94,5,3,0,1,12,44.03,"MIT License",false,"main",true,[24,25,26,27,28,29,30,31],"comfyui","comfyui-custom-nodes","comfyui-workflow","hi-diff","image-deblurring","miscfilter","motion-deblurring","photo-restoration","2026-11-07 15:08:46","2026-11-20 06:38:52","# ComfyUI-PhotoDeblur\n\n**English** | [简体中文](README_中文.md)\n\nNative **HI-Diff** and **MISCFilter** photo deblurring nodes for ComfyUI. Supports original-resolution tiled processing, overlap blending, optional TTA, and official model downloads.\n\n## Before \u002F after\n\nReal photo examples, cropped from the same area at the same scale. Left: original. Right: restored. Click an image to view the full-size comparison; settings are shown beneath each pair.\n\n### HI-Diff\n\n**Street signs:** clearer lettering and architectural edges.\n\n![HI-Diff: street signs before and after](docs\u002Fimages\u002Fhi-street-signs.jpg)\n\n**Storefront:** reduced camera shake around signs and outlines.\n\n![HI-Diff: storefront before and after](docs\u002Fimages\u002Fhi-storefront.jpg)\n\n### MISCFilter\n\n**Camera display:** clearer camera and lens outlines.\n\n![MISCFilter: camera display before and after](docs\u002Fimages\u002Fmisc-camera-display.jpg)\n\n**Colorful wafer:** reduced ghosting along grid lines and circular edges.\n\n![MISCFilter: colorful wafer before and after](docs\u002Fimages\u002Fmisc-wafer.jpg)\n\n**City at night:** reduced light trails on buildings. This example uses TTA and tone matching (sigma 16).\n\n![MISCFilter: city at night before and after](docs\u002Fimages\u002Fmisc-night-city.jpg)\n\n## Which photos should I try?\n\nUse these nodes to reduce camera-shake and motion blur before further color grading or cropping.\n\n| Scene | What to inspect |\n| --- | --- |\n| Handheld night and indoor photos | Trails around signs, window frames and furniture |\n| Architecture, storefronts and street scenes | Lines, text outlines and repeated textures |\n| Portraits and event photos | Mild to moderate shake around facial features, hair and clothing |\n| Animals and moving subjects | Motion trails on the subject, alongside areas that were already sharp |\n| High-resolution photos | Keep the original dimensions through tiling, then crop or downsize afterward |\n\n**Our experience:** the bookstore night photo showed noticeable improvements in the sign and some structural edges. Results on night portraits varied. A small, heavily blurred stage face and a cat's face showed limited improvement in some tests. These are subjective observations from a small photo set, offered as a starting point.\n\n## Practical tips\n\n- Start with **RealBlur_J, tile 768, overlap 96 and TTA off**, comparing both models on the same original image.\n- MISCFilter has no sampling steps; leave HI-Diff steps at `0` initially. Choose between them by local detail and the overall appearance.\n- Inspect text, faces and high-contrast edges at matching zoom levels. Save TTA and larger-tile results separately for comparison.\n- Defocus, detail lost in clipped highlights and very small faces are usually harder to restore than ordinary camera shake. With noisy inputs, also check whether shadow texture is smoothed away or amplified.\n- Background blur in panning or shallow-depth-of-field photos may be intentional. To restore only the subject, blend the result with the original using a mask in your photo editor.\n- Develop RAW files first and use sRGB TIFF\u002FPNG inputs. Save a 16-bit PNG if you plan to continue color grading.\n\n## Installation\n\nClone this repository into `ComfyUI\u002Fcustom_nodes`:\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002Fporfeng\u002FComfyUI-PhotoDeblur.git\n```\n\nRun these commands with **ComfyUI's Python**, from the node folder:\n\n```sh\npython -m pip install -r requirements.txt\npython -m pip install -r requirements-download.txt\n```\n\nFor **MISCFilter on NVIDIA \u002F CUDA 12**, also install:\n\n```sh\npython -m pip install -r requirements-misc-cu12.txt\n```\n\nOptional tone matching needs OpenCV. If `cv2` is missing:\n\n```sh\npython -m pip install -r requirements-tone.txt\n```\n\nFor the Windows portable edition, replace `python` with its `python_embeded\u002Fpython.exe`. For Desktop, use its environment's Python. Restart ComfyUI after installing.\n\n## Quick start\n\n1. Drag a workflow from [example_workflows](example_workflows) onto the canvas. [ComfyUI-PhotoDeblur.json](example_workflows\u002FComfyUI-PhotoDeblur.json) includes Chinese and English notes.\n2. Select your own image in **Load Image**.\n3. Match the downloader's model and variant to the loader, then run.\n\n```text\nDownload Deblur Models.ready → Model Loader.download_ready\nLoad Image → Deblur Image (Tiled).image\nModel Loader → Deblur Image (Tiled).deblur_model\nDeblur Image (Tiled) IMAGE → Save Image\n```\n\nThe restored IMAGE output connects to Save Image. If weights are already installed, the download connection is optional. To use HI-Diff, connect its loader instead of MISCFilter and select HI-Diff in the downloader.\n\n## Nodes\n\n| Node | Purpose |\n| --- | --- |\n| Download Deblur Models | Download and verify official weights |\n| HI-Diff Model Loader | Select HI-Diff weights and sampling steps |\n| MISCFilter Model Loader | Select MISCFilter weights |\n| Deblur Image (Tiled) | Restore the image with tiling, blending and optional TTA |\n| Match Input Tone (Optional) | Reduce broad color shifts using the original image |\n\nSearch for `Photo Deblur` on the canvas to find these nodes.\n\n## Parameters\n\n| Parameter | Suggested starting value \u002F meaning |\n| --- | --- |\n| variant | `RealBlur_J`; also compare `RealBlur_R` and `GoPro` |\n| tile_size | `768`; try `512` when VRAM is limited |\n| overlap | `96` at tile 768, or `64` at tile 512; must be smaller than the tile |\n| blend | `comfy_linear`; alternatives: `cosine`, `gaussian`, `average` |\n| tta | Off initially; averages eight flipped\u002Frotated predictions, roughly 8× model computation |\n| seed | `100`; controls HI-Diff's random prior |\n| steps | HI-Diff only: `0` selects 16 for J\u002FR and 8 for GoPro |\n| repair_invalid | Off normally; on backs up mismatched files before replacing them |\n| sigma | Tone matching only: `16`; `0` bypasses correction |\n\nMISCFilter uses a direct network forward pass and has no sampling steps. Larger tiles, more steps and TTA are comparison options; choose by the result on your photo.\n\n## Model weights\n\nBoth models offer **RealBlur_J**, **RealBlur_R** and **GoPro**, corresponding to different training datasets\u002Fvariants. R is a checkpoint variant, not a camera RAW input mode.\n\nThe download node uses the authors' Google Drive archives with SHA256 verification. Verified local files are reused. Weights are stored in ComfyUI's configured model directory:\n\n```text\nmodels\u002F\n├── HI-Diff\u002F\n│   ├── HI_Diff_RealBlur_J\u002F  # net_g.pth, net_le_dm.pth, net_d.pth\n│   ├── HI_Diff_RealBlur_R\u002F  # same three filenames\n│   └── HI_Diff_GoPro\u002F       # same three filenames\n└── MISCFilter\u002F\n    ├── RealBlur_J.pth\n    ├── RealBlur_R.pth\n    └── GoPro.pth\n```\n\n### Manual download and installation\n\nTo install weights without the download node, use these official downloads:\n\n| Model | Variant | Download |\n| --- | --- | --- |\n| HI-Diff | RealBlur-J | [HI_Diff_RealBlur_J.zip](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1zdAOurzjAONRmLuPmSi0nppyqT2ORIRg\u002Fview) |\n| HI-Diff | RealBlur-R | [HI_Diff_RealBlur_R.zip](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1inQwZ6SJIHYyZoQo702Mv4upjvgg3kFA\u002Fview) |\n| HI-Diff | GoPro | [HI_Diff_GoPro.zip](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1cx0vCV5Z5fklnbqonZQad37vt4armEbT\u002Fview) |\n| MISCFilter | J \u002F R \u002F GoPro | [checkpoints.zip (all three variants)](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1XsySc2rDCzoqZ0-Ph1dFYQ49_APb5Eay\u002Fview) |\n\n1. Download and extract the archive you need.\n2. **HI-Diff:** locate the matching `net_g.pth`, `net_le_dm.pth` and `net_d.pth`, and place all three in the corresponding variant directory shown above. For example: `ComfyUI\u002Fmodels\u002FHI-Diff\u002FHI_Diff_RealBlur_J\u002Fnet_g.pth`. Keep the three variants in separate directories.\n3. **MISCFilter:** locate `RealBlur_J.pth`, `RealBlur_R.pth` and `GoPro.pth`, and copy the variants you need into `ComfyUI\u002Fmodels\u002FMISCFilter\u002F`, keeping the filenames unchanged.\n4. Select the installed variant in the matching model loader and connect it to the tiled deblurring node. Disconnect or remove the download node when loading manually installed weights.\n\nHere, `ComfyUI\u002Fmodels` means the model directory configured for your installation; Desktop may use your chosen data directory. The final `.pth` paths should match the tree above, without an extra archive directory level.\n\nManual downloading does not require gdown. MISCFilter still requires the CuPy setup described under Installation. Sources: [official HI-Diff repository](https:\u002F\u002Fgithub.com\u002Fzhengchen1999\u002FHI-Diff#models), [official MISCFilter repository](https:\u002F\u002Fgithub.com\u002FChengxuLiu\u002FMISCFilter#models).\n\n## Precision and color\n\nInference and blending use FP32 RGB\u002FRGBA tensors at the original image size. Use display-referred sRGB images; develop RAW files before loading. The nodes output values in 0–1.\n\n16-bit TIFF\u002FPNG precision depends on the image loader. Standard Save Image writes 8-bit PNG; for 16-bit output, use **Save Image (Advanced) → PNG → 16-bit → sRGB** when available. A blank TIFF thumbnail can be checked with Preview Image.\n\nTone matching is optional post-processing added by this project. It subtracts the Gaussian-blurred difference between the restored and original images to constrain broad color changes.\n\n## Setup help\n\n- **Missing CuPy:** install `requirements-misc-cu12.txt` in ComfyUI's Python.\n- **CUDA \u002F NVRTC error:** check the matching CuPy package and local CUDA Toolkit \u002F `CUDA_PATH`.\n- **Missing weights:** use the download node or the directory structure above.\n- **Out of memory:** try tile 512, overlap 64 and TTA off.\n\n## Credits and license\n\n- [HI-Diff](https:\u002F\u002Fgithub.com\u002Fzhengchen1999\u002FHI-Diff), NeurIPS 2023 — Apache-2.0.\n- [MISCFilter](https:\u002F\u002Fgithub.com\u002FChengxuLiu\u002FMISCFilter), CVPR 2024 — MIT.\n\nNode integration code: [MIT](LICENSE). Upstream notices and port changes: [THIRD_PARTY.md](THIRD_PARTY.md). Model weights are downloaded separately from upstream sources.\n","这是一个为ComfyUI设计的图像去模糊插件，集成HI-Diff与MISCFilter两种先进模型，专用于修复手抖和运动模糊导致的摄影退化。核心功能包括原图尺寸分块处理、重叠融合、可选TTA增强及一键模型下载；技术上支持高保真边缘恢复（如文字、建筑轮廓）与低伪影光迹抑制（如夜景灯光拖影）。适用于手持夜拍、室内摄影、街景建筑、活动人像等存在中轻度运动模糊的真实场景，常作为AI修图工作流的前置预处理节点。",2,"2026-11-24 04:39:37","CREATED_QUERY"]