Skip to content

Commit

Permalink
add PK_HOOK feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ltdrdata committed May 10, 2023
1 parent dfbd1e1 commit b1893c4
Show file tree
Hide file tree
Showing 10 changed files with 361 additions and 131 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ This custom node helps to conveniently enhance images through Detector, Detailer
* Similar to 'Latent Scale (on Pixel Space)', if upscale_model_opt is provided, it performs pixel upscaling using the model.
* PixelTiledKSampleUpscalerProvider - It is similar to PixelKSampleUpscalerProvider, but it uses ComfyUI_TiledKSampler and Tiled VAE Decoder/Encoder to avoid GPU VRAM issues at high resolutions.
* You need to install the [ComfyUI_TiledKSampler](https://github.com/BlenderNeko/ComfyUI_TiledKSampler) node extension.

* DenoiseScheduleHookProvider - IterativeUpscale provides a hook that gradually changes the denoise to target_denoise as the step progresses.
* CfgScheduleHookProvider - IterativeUpscale provides a hook that gradually changes the cfg to target_cfg as the step progresses.
* PixelKSampleHookCombine - This is used to connect two PK_HOOKs. hook1 is executed first and then hook2 is executed.
* If you want to simultaneously change cfg and denoise, you can combine the PK_HOOKs of CfgScheduleHookProvider and PixelKSampleHookCombine.

* Iterative Upscale (Latent) - The upscaler takes the input upscaler and splits the scale_factor into steps, then iteratively performs upscaling.
This takes latent as input and outputs latent as the result.
* Iterative Upscale (Image) - The upscaler takes the input upscaler and splits the scale_factor into steps, then iteratively performs upscaling. This takes image as input and outputs image as the result.
Expand Down Expand Up @@ -75,7 +81,11 @@ This takes latent as input and outputs latent as the result.

* mim install
* mmcv==2.0.0, mmdet==3.0.0, mmengine==0.7.2


* linux packages (ubuntu)
* libgl1-mesa-glx
* libglib2.0-0

# Other Materials (auto-download on initial startup)

* ComfyUI/models/mmdets/bbox <= https://huggingface.co/dustysys/ddetailer/resolve/main/mmdet/bbox/mmdet_anime-face_yolov3.pth
Expand Down Expand Up @@ -136,6 +146,7 @@ This takes latent as input and outputs latent as the result.
* [ONNX Tutorial](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/ONNX.md)
* [CLIPSeg Tutorial](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/clipseg.md)
* [Extreme Highresolution Upscale](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/extreme-upscale.md)
* [PK_HOOK](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/pk_hook.md)


# Credits
Expand Down
4 changes: 4 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ def setup_js():
"PixelTiledKSampleUpscalerProvider": PixelTiledKSampleUpscalerProvider,
"PixelTiledKSampleUpscalerProviderPipe": PixelTiledKSampleUpscalerProviderPipe,

"PixelKSampleHookCombine": PixelKSampleHookCombine,
"DenoiseScheduleHookProvider": DenoiseScheduleHookProvider,
"CfgScheduleHookProvider": CfgScheduleHookProvider,

"BitwiseAndMask": BitwiseAndMask,
"SubtractMask": SubtractMask,
"Segs & Mask": SegsBitwiseAndMask,
Expand Down
9 changes: 9 additions & 0 deletions additional_dependencies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import sys
import subprocess


def ensure_onnx_package():
try:
import onnxruntime
except Exception:
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'onnxruntime'])
2 changes: 1 addition & 1 deletion impact_config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import configparser
import os

version = "V2.2"
version = "V2.3"

dependency_version = 1

Expand Down
Loading

0 comments on commit b1893c4

Please sign in to comment.