Compare commits

...
48 Commits
Author SHA1 Message Date
Dr.Lt.Data 705698faf2 bump version 2025-06-19 12:40:42 +09:00
Dr.Lt.Data cf43fc4e3c fix: typo in locales 2025-06-19 12:39:30 +09:00
robo 4c292e684e change wildcard {} regex to allow escaping (#968) 2025-06-19 12:39:06 +09:00
Dr.Lt.Data 65f1363a10 feat: LamaRemoverDetailerHookProvider is added 2025-06-17 23:40:50 +09:00
Dr.Lt.Data f57d309932 fixed: avoid potential conflict
- If everything is working as expected, this conflict shouldn't occur. However, some node pack might be adding the `impact` module to `sys.path`.

https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/1022
2025-06-17 00:46:43 +09:00
NicolasKlenert 6ccf9bab68 fixed: SegmDetectorCombined - incorrect empty mask dimension (#1021) 2025-06-16 12:34:56 +09:00
Dr.Lt.Data ac3668d946 feat: CustomSamplerDetailerHookProvider is added
https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/957
2025-06-11 21:52:25 +09:00
Emmanuel Ferdman 78d3793a77 Resolve regex library warnings (#1011)
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2025-06-10 12:35:46 +09:00
Dr.Lt.Data 2346b67766 fixed: Switch (Any) - copy&paste error
https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/1012
2025-06-01 04:52:24 +09:00
Dr.Lt.Data 025db4b581 fixed: MaskRectArea - type error
https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/1001
2025-06-01 04:43:46 +09:00
Dr.Lt.Data f8e16df2be bump version 2025-05-19 08:33:30 +09:00
Dr.Lt.Data 7df60b2107 fixed: install.py - user friendly message with exception handling 2025-05-19 08:31:07 +09:00
Dr.Lt.Data b394c158ea modified: requirements.txt remove pinning <2 for numpy 2025-05-19 05:16:00 +09:00
Dr.Lt.Data 3e3cf3a5b4 support nunchaku lora loading in the wildcard feature
https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/993
2025-05-18 18:14:42 +09:00
Dr.Lt.Data 93fc248503 fixed: cannot connect wildcard input/output to the Switch / InversedSwitch nodes
https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/992
2025-05-16 04:42:26 +09:00
Dr.Lt.Data 16ffa7d462 hotfix: potential front error
```
TypeError: Cannot read properties of undefined (reading 'type')
```

https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/989
2025-05-16 03:59:10 +09:00
filtered cd34cfdd63 Fix empty widgets array throws in console (#988) 2025-05-03 14:37:31 +09:00
Dr.Lt.Data 38bb9ffdf6 fixed: Switch - buggy behavior on firefox browser
https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/983#issuecomment-2833471721
2025-04-28 00:54:31 +09:00
Dr.Lt.Data f939e66e1c fixed: this.widgets is undefined
https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/977
2025-04-27 22:16:11 +09:00
robo b22aa90cf4 allow for .yml files in wildcards (#966)
both are valid yaml extensions so it makes sense to allow both
2025-04-25 18:50:40 +09:00
Dr.Lt.Data d18aaecb93 bump version 2025-04-25 18:46:18 +09:00
だにえる a7840b4fbf feat: tensor_paste supports RGBA images with alpha channel blending (#962)
This enhancement adds support for properly handling RGBA images in the tensor_paste function.

The previous implementation caused errors when pasting images with alpha channels.
Now the function can handle all combinations of RGB and RGBA images:
- RGB to RGB (unchanged)
- RGBA to RGBA (with proper alpha compositing)
- RGB to RGBA
- RGBA to RGB

Fix for the error: "RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 3"
2025-04-25 18:35:03 +09:00
robo efa0cb66b2 always use impact.wildcards.process fixes server side wildcards.process not getting new wildcard_dict (#967) 2025-04-25 18:21:55 +09:00
Dr.Lt.Data 0b94005b1b hotfix: impactswitch - frontend crash
https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/970#issuecomment-2827153556
2025-04-25 08:03:20 +09:00
Dr.Lt.Data bfcb8674b3 feat: Select Nth Item (Any list)
https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/971
2025-04-24 18:00:37 +09:00
Dr.Lt.Data 839e5a9f90 fixed: ImpactSwitch - slot was not shrinked when disconnecting
fixed: ImpactSwitch - invalid upper bounding of the select value

https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/972
2025-04-24 12:38:35 +09:00
Dr.Lt.Data 5a2adda580 fixed: impact switch - compatibility patch with new front
https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/964
2025-04-22 02:06:08 +09:00
Dr.Lt.Data d05882a9e0 refactor: remove useless legacy code 2025-04-22 01:33:58 +09:00
Dr.Lt.Data d900939861 feat: Impact Sampler - support OSS scheduler 2025-04-13 10:24:35 +09:00
Jaquan cd2696f6fd fix #946 InversedSwitch(Any) was not append outputs after first connect (#956)
InversedSwitch(Any) not increasing number of outputs after connecting first output  (in )
# 953  #946
In the latest ComfyUI_frontend version, output is not appended as expected
2025-04-12 19:01:00 +09:00
Dr.Lt.Data 0b1ac0f1c5 bump version to v8.10 2025-03-24 00:06:42 +09:00
chutchatut 216d7fd60c Added sort=None to SEGS order filter (#944)
* added pick first N SEGs node

* remove take first N segs node and update segs order filter to add order=None

* add comments

* update for readibility

* format code

* remove match statement
2025-03-24 00:06:06 +09:00
chutchatut 28cd2f70b2 Update README.md (#943) 2025-03-21 19:06:24 +09:00
Dr.Lt.Data 2708eba825 bump version v8.9 2025-03-20 21:36:25 +09:00
chutchatut c19ab92172 add intersection and non max suppression SEGS filter (#940) 2025-03-20 21:21:15 +09:00
Robin Huangandsnomiao 6e3d07277b chore(publish): update workflow for node publishing with conditional execution and permissions (#935)
Co-authored-by: snomiao <snomiao+comfy-pr@gmail.com>
2025-03-17 00:19:33 +09:00
Dr.Lt.Data 782c6f439e fixed: controlbridge - better error message
- mute/bypass behavior cannot be used in api mode

https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/933
2025-03-12 18:10:42 +09:00
Dr.Lt.Data 0e3e6a193a improved: SAM Loader - don't add 'ESAM' if 'ComfyUI-YoloWorld-EfficientSAM' is not installed 2025-03-04 22:44:31 +09:00
Dr.Lt.Data 798776838e remove sample_error_enhancer 2025-03-04 12:43:03 +09:00
Dr.Lt.Data 66493d8cb4 formatting.. 2025-03-02 16:56:59 +09:00
Dr.Lt.Data b4fd0834e0 fixed: crash when loading api json
https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/919
2025-03-02 16:54:16 +09:00
Dr.Lt.Data 808b0dedf0 update README.md 2025-02-23 10:03:04 +09:00
Dr.Lt.Data c6056b132d add example workflow 2025-02-15 11:04:03 +09:00
Dr.Lt.Data 1ae7cae2df version marker 2025-02-02 15:05:41 +09:00
izmp ccb6285548 Fixed several issues related to number handling and wildcard processing (#896) 2025-02-02 15:04:57 +09:00
Dr.Lt.Data 092310bc8f refactor: impact_sampling 2025-01-31 21:01:03 +09:00
Dr.Lt.Data 5c530eb32e fixed: wildcards - cannot edit populated_text on 'fixed' mode
https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/898
2025-01-30 16:55:01 +09:00
Dr.Lt.Data e35bc23fd1 add locales partly.
added: more descriptions
added: locales/ko
2025-01-30 16:49:23 +09:00
41 changed files with 10533 additions and 349 deletions
+6 -2
View File
@@ -7,15 +7,19 @@ on:
paths:
- "pyproject.toml"
permissions:
issues: write
jobs:
publish-node:
name: Publish Custom Node to registry
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'ltdrdata' }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Publish Custom Node
uses: Comfy-Org/publish-node-action@main
uses: Comfy-Org/publish-node-action@v1
with:
## Add your own personal access token to your Github Repository secrets and reference it here.
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
+35 -1
View File
@@ -32,6 +32,31 @@ NOTE: The UltralyticsDetectorProvider node is not part of the ComfyUI-Impact-Pac
* With the addition of wildcard support in FaceDetailer, the structure of DETAILER_PIPE-related nodes and Detailer nodes has changed. There may be malfunctions when using the existing workflow.
## How To Install
### **Recommended**
* Install via [ComfyUI-Manager](https://github.com/ltdrdata/ComfyUI-Manager).
### **Manual**
* Navigate to `ComfyUI/custom_nodes` in your terminal (cmd).
* Clone the repository under the `custom_nodes` directory using the following command:
```
git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack comfyui-impact-pack
cd comfyui-impact-pack
```
* Install dependencies in your Python environment.
* For Windows Portable, run the following command inside `ComfyUI\custom_nodes\comfyui-impact-pack`:
```
..\..\..\python_embeded\python.exe -m pip install -r requirements.txt
```
* If using venv or conda, activate your Python environment first, then run:
```
pip install -r requirements.txt
```
### Companion Pack
* If you need the `Ultralytics Detector Provider` to use various YOLO detection models, you should also install [ComfyUI-Impact-Subpack](https://github.com/ltdrdata/ComfyUI-Impact-Subpack).
## Custom Nodes
### [Detector nodes](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/detectors.md)
* `SAMLoader` - Loads the SAM model.
@@ -107,6 +132,8 @@ NOTE: The UltralyticsDetectorProvider node is not part of the ComfyUI-Impact-Pac
* `SEGS Filter (label)` - This node filters SEGS based on the label of the detected areas.
* `SEGS Filter (ordered)` - This node sorts SEGS based on size and position and retrieves SEGs within a certain range.
* `SEGS Filter (range)` - This node retrieves only SEGs from SEGS that have a size and position within a certain range.
* `SEGS Filter (non max suppression)` - This node filters SEGS by removing those with high overlap based on the Intersection over Union (IoU) threshold, keeping only the most confident detections.
* `SEGS Filter (intersection)` - This node filters segs1, keeping only the SEGS that do not significantly overlap with any SEGS in segs2, based on the Intersection over Area (IoA) threshold.
* `SEGS Assign (label)` - Assign labels sequentially to SEGS. This node is useful when used with `[LAB]` of FaceDetailer.
* `SEGSConcat` - Concatenate segs1 and segs2. If source shape of segs1 and segs2 are different from segs2 will be ignored.
* `SEGS Merge` - SEGS contains multiple SEGs. SEGS Merge integrates several SEGs into a single merged SEG. The label is changed to `merged` and the confidence becomes the minimum confidence. The applied controlnet and cropped_image are removed.
@@ -162,6 +189,10 @@ NOTE: The UltralyticsDetectorProvider node is not part of the ComfyUI-Impact-Pac
* `PreviewDetailerHook` - Connecting this hook node helps provide assistance for viewing previews whenever SEGS Detailing tasks are completed. When working with a large number of SEGS, such as Make Tile SEGS, it allows for monitoring the situation as improvements progress incrementally.
* Since this is the hook applied when pasting onto the original image, it has no effect on nodes like `SEGSDetailer`.
* `VariationNoiseDetailerHookProvider` - Apply variation seed to the detailer. It can be applied in multiple stages through combine.
* `CustomSamplerDetailerHookProvider` - Apply a hook that allows you to use a custom sampler in the Detailer nodes. When using `DetailerHookCombine`, the sampler from the first hook is applied.
* `LamaRemoverDetailerHookProvider` – Applies Lama Remover to the upscaled image during the detailing stage. If `skip_sampling` is set to True, Lama Remover can be used alone without the detailing stage, allowing it to simply remove detected regions.
* Not applicable for **AnimateDiff** detailers. When using `DetailerHookCombine`, `skip_sampling` is only applied if it is set to `True` for all hooks.
* To use this node, the node pack at [Layer-norm/comfyui-lama-remover](https://github.com/Layer-norm/comfyui-lama-remover) must be installed.
### Iterative Upscale nodes
* `Iterative Upscale (Latent/on Pixel Space)` - The upscaler takes the input upscaler and splits the scale_factor into steps, then iteratively performs upscaling.
@@ -224,7 +255,7 @@ NOTE: The UltralyticsDetectorProvider node is not part of the ComfyUI-Impact-Pac
### Impact KSampler
* These samplers support basic_pipe and AYS scheduler
* These samplers support basic_pipe and AYS/OSS/GITS scheduler
* `KSampler (pipe)` - pipe version of KSampler
* `KSampler (advanced/pipe)` - pipe version of KSamplerAdvacned
* When converting the scheduler widget to input, refer to the `Impact Scheduler Adapter` node to resolve compatibility issues.
@@ -241,6 +272,7 @@ NOTE: The UltralyticsDetectorProvider node is not part of the ComfyUI-Impact-Pac
* `Masks to Mask List`, `Mask List to Masks`, `Make Mask List`, `Make Mask Batch` - It has the same functionality as the nodes above, but uses mask as input instead of image.
* `Flatten Mask Batch` - Flattens a Mask Batch into a single Mask. Normal operation is not guaranteed for non-binary masks.
* `Make List (Any)` - Create a list with arbitrary values.
* `Select Nth Item (Any list)` - Selects the Nth item from a list. If the index is out of range, it returns the last item in the list.
### Logics (experimental)
* These nodes are experimental nodes designed to implement the logic for loops and dynamic switching.
@@ -460,3 +492,5 @@ BlenderNeok/[ComfyUI_Noise](https://github.com/BlenderNeko/ComfyUI_Noise) - The
WASasquatch/[was-node-suite-comfyui](https://github.com/WASasquatch/was-node-suite-comfyui) - A powerful custom node extensions of ComfyUI.
Trung0246/[ComfyUI-0246](https://github.com/Trung0246/ComfyUI-0246) - Nice bypass hack!
Layer-norm/[comfyui-lama-remover](https://github.com/Layer-norm/comfyui-lama-remover) - Required for using `LamaRemoverDetailerHook`.
+8 -1
View File
@@ -18,7 +18,6 @@ modules_path = os.path.join(os.path.dirname(__file__), "modules")
sys.path.append(modules_path)
import impact.config
import impact.sample_error_enhancer
print(f"### Loading: ComfyUI-Impact-Pack ({impact.config.version})")
# Core
@@ -123,6 +122,8 @@ NODE_CLASS_MAPPINGS = {
"UnsamplerHookProvider": UnsamplerHookProvider,
"CoreMLDetailerHookProvider": CoreMLDetailerHookProvider,
"PreviewDetailerHookProvider": PreviewDetailerHookProvider,
"CustomSamplerDetailerHookProvider": CustomSamplerDetailerHookProvider,
"LamaRemoverDetailerHookProvider": LamaRemoverDetailerHookProvider,
"DetailerHookCombine": DetailerHookCombine,
"NoiseInjectionDetailerHookProvider": NoiseInjectionDetailerHookProvider,
@@ -235,6 +236,7 @@ NODE_CLASS_MAPPINGS = {
"ImpactMakeAnyList": MakeAnyList,
"ImpactMakeMaskList": MakeMaskList,
"ImpactMakeMaskBatch": MakeMaskBatch,
"ImpactSelectNthItemOfAnyList": NthItemOfAnyList,
"RegionalSampler": RegionalSampler,
"RegionalSamplerAdvanced": RegionalSamplerAdvanced,
@@ -248,6 +250,8 @@ NODE_CLASS_MAPPINGS = {
"ImpactSEGSLabelFilter": SEGSLabelFilter,
"ImpactSEGSRangeFilter": SEGSRangeFilter,
"ImpactSEGSOrderedFilter": SEGSOrderedFilter,
"ImpactSEGSIntersectionFilter": SEGSIntersectionFilter,
"ImpactSEGSNMSFilter": SEGSNMSFilter,
"ImpactCompare": ImpactCompare,
"ImpactConditionalBranch": ImpactConditionalBranch,
@@ -363,6 +367,8 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"ImpactSEGSLabelFilter": "SEGS Filter (label)",
"ImpactSEGSRangeFilter": "SEGS Filter (range)",
"ImpactSEGSOrderedFilter": "SEGS Filter (ordered)",
"ImpactSEGSIntersectionFilter": "SEGS Filter (intersection)",
"ImpactSEGSNMSFilter": "SEGS Filter (non max suppression)",
"ImpactSEGSConcat": "SEGS Concat",
"ImpactSEGSToMaskList": "SEGS to Mask List",
"ImpactSEGSToMaskBatch": "SEGS to Mask Batch",
@@ -404,6 +410,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"ImpactMakeMaskList": "Make Mask List",
"ImpactMakeMaskBatch": "Make Mask Batch",
"ImpactMakeAnyList": "Make List (Any)",
"ImpactSelectNthItemOfAnyList": "Select Nth Item (Any list)",
"ImpactStringSelector": "String Selector",
"StringListToString": "String List to String",
Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

+596
View File
@@ -0,0 +1,596 @@
{
"last_node_id": 5,
"last_link_id": 5,
"nodes": [
{
"id": 1,
"type": "LoadImage",
"pos": [
30,
210
],
"size": [
390,
320
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"shape": 3,
"links": [
1
]
},
{
"name": "MASK",
"type": "MASK",
"shape": 3,
"links": [
2
]
}
],
"properties": {
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"clipspace/clipspace-mask-609196.2000000011.png [input]",
"image"
]
},
{
"id": 5,
"type": "PreviewImage",
"pos": [
1230,
210
],
"size": [
210,
246
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 5
}
],
"outputs": [],
"properties": {
"Node name for S&R": "PreviewImage"
},
"widgets_values": []
},
{
"id": 3,
"type": "workflow>Impact::MAKE_BASIC_PIPE",
"pos": [
20,
620
],
"size": [
400,
200
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "basic_pipe",
"type": "BASIC_PIPE",
"shape": 3,
"links": [
3
]
}
],
"properties": {
"Node name for S&R": "workflow/Impact::MAKE_BASIC_PIPE"
},
"widgets_values": [
"SD1.5/realcartoon3d_v13.safetensors",
"(best quality:1.4), fox girl",
"(worst quality:1.4), nsfw"
]
},
{
"id": 2,
"type": "MaskDetailerPipe",
"pos": [
530,
210
],
"size": [
569.4000244140625,
850
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 1
},
{
"name": "mask",
"type": "MASK",
"link": 2
},
{
"name": "basic_pipe",
"type": "BASIC_PIPE",
"link": 3,
"slot_index": 2
},
{
"name": "refiner_basic_pipe_opt",
"type": "BASIC_PIPE",
"shape": 7,
"link": null
},
{
"name": "detailer_hook",
"type": "DETAILER_HOOK",
"shape": 7,
"link": null
},
{
"name": "scheduler_func_opt",
"type": "SCHEDULER_FUNC",
"shape": 7,
"link": null
}
],
"outputs": [
{
"name": "image",
"type": "IMAGE",
"shape": 3,
"links": [
5
],
"slot_index": 0
},
{
"name": "cropped_refined",
"type": "IMAGE",
"shape": 6,
"links": null
},
{
"name": "cropped_enhanced_alpha",
"type": "IMAGE",
"shape": 6,
"links": [
4
],
"slot_index": 2
},
{
"name": "basic_pipe",
"type": "BASIC_PIPE",
"shape": 3,
"links": null
},
{
"name": "refiner_basic_pipe_opt",
"type": "BASIC_PIPE",
"shape": 3,
"links": null
}
],
"properties": {
"Node name for S&R": "MaskDetailerPipe"
},
"widgets_values": [
512,
true,
1024,
true,
1003,
"fixed",
20,
8,
"euler",
"normal",
0.75,
5,
3,
10,
0.2,
1,
1,
false,
20,
false,
false
],
"color": "#322",
"bgcolor": "#533"
},
{
"id": 4,
"type": "PreviewImage",
"pos": [
1230,
560
],
"size": [
210,
246
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 4
}
],
"outputs": [],
"properties": {
"Node name for S&R": "PreviewImage"
},
"widgets_values": []
}
],
"links": [
[
1,
1,
0,
2,
0,
"IMAGE"
],
[
2,
1,
1,
2,
1,
"MASK"
],
[
3,
3,
0,
2,
2,
"BASIC_PIPE"
],
[
4,
2,
2,
4,
0,
"IMAGE"
],
[
5,
2,
0,
5,
0,
"IMAGE"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 1,
"offset": [
80,
-110
]
},
"groupNodes": {
"Impact::MAKE_BASIC_PIPE": {
"author": "Dr.Lt.Data",
"category": "",
"config": {
"1": {
"input": {
"text": {
"name": "Positive prompt"
}
}
},
"2": {
"input": {
"text": {
"name": "Negative prompt"
}
}
}
},
"datetime": 1708272471445,
"external": [],
"links": [
[
0,
1,
1,
0,
1,
"CLIP"
],
[
0,
1,
2,
0,
1,
"CLIP"
],
[
0,
0,
3,
0,
1,
"MODEL"
],
[
0,
1,
3,
1,
1,
"CLIP"
],
[
0,
2,
3,
2,
1,
"VAE"
],
[
1,
0,
3,
3,
3,
"CONDITIONING"
],
[
2,
0,
3,
4,
4,
"CONDITIONING"
]
],
"nodes": [
{
"flags": {},
"index": 0,
"mode": 0,
"order": 0,
"outputs": [
{
"links": [],
"name": "MODEL",
"shape": 3,
"slot_index": 0,
"type": "MODEL",
"localized_name": "MODEL"
},
{
"links": [],
"name": "CLIP",
"shape": 3,
"slot_index": 1,
"type": "CLIP",
"localized_name": "CLIP"
},
{
"links": [],
"name": "VAE",
"shape": 3,
"slot_index": 2,
"type": "VAE",
"localized_name": "VAE"
}
],
"pos": [
550,
360
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple"
},
"size": {
"0": 315,
"1": 98
},
"type": "CheckpointLoaderSimple",
"widgets_values": [
"SDXL/sd_xl_base_1.0_0.9vae.safetensors"
],
"inputs": []
},
{
"flags": {},
"index": 1,
"inputs": [
{
"link": null,
"name": "clip",
"type": "CLIP",
"localized_name": "clip"
}
],
"mode": 0,
"order": 1,
"outputs": [
{
"links": [],
"name": "CONDITIONING",
"shape": 3,
"slot_index": 0,
"type": "CONDITIONING",
"localized_name": "CONDITIONING"
}
],
"pos": [
940,
480
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"size": {
"0": 263,
"1": 99
},
"title": "Positive",
"type": "CLIPTextEncode",
"widgets_values": [
""
]
},
{
"flags": {},
"index": 2,
"inputs": [
{
"link": null,
"name": "clip",
"type": "CLIP",
"localized_name": "clip"
}
],
"mode": 0,
"order": 2,
"outputs": [
{
"links": [],
"name": "CONDITIONING",
"shape": 3,
"slot_index": 0,
"type": "CONDITIONING",
"localized_name": "CONDITIONING"
}
],
"pos": [
940,
640
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"size": {
"0": 263,
"1": 99
},
"title": "Negative",
"type": "CLIPTextEncode",
"widgets_values": [
""
]
},
{
"flags": {},
"index": 3,
"inputs": [
{
"link": null,
"name": "model",
"type": "MODEL",
"localized_name": "model"
},
{
"link": null,
"name": "clip",
"type": "CLIP",
"localized_name": "clip"
},
{
"link": null,
"name": "vae",
"type": "VAE",
"localized_name": "vae"
},
{
"link": null,
"name": "positive",
"type": "CONDITIONING",
"localized_name": "positive"
},
{
"link": null,
"name": "negative",
"type": "CONDITIONING",
"localized_name": "negative"
}
],
"mode": 0,
"order": 3,
"outputs": [
{
"links": null,
"name": "basic_pipe",
"shape": 3,
"slot_index": 0,
"type": "BASIC_PIPE",
"localized_name": "basic_pipe"
}
],
"pos": [
1320,
360
],
"properties": {
"Node name for S&R": "ToBasicPipe"
},
"size": {
"0": 241.79998779296875,
"1": 106
},
"type": "ToBasicPipe"
}
],
"packname": "Impact",
"version": "1.0"
}
},
"controller_panel": {
"controllers": {},
"hidden": true,
"highlight": true,
"version": 2,
"default_order": []
},
"node_versions": {
"comfy-core": "0.3.14",
"comfyui-impact-pack": "1ae7cae2df8cca06027edfa3a24512671239d6c4"
},
"ue_links": [],
"VHS_latentpreview": false,
"VHS_latentpreviewrate": 0,
"VHS_MetadataImage": true,
"VHS_KeepIntermediate": true
},
"version": 0.4
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 526 KiB

File diff suppressed because it is too large Load Diff
+14 -12
View File
@@ -68,7 +68,6 @@ def process_wrap(cmd_str, cwd=None, handler=None, env=None):
try:
import platform
from torchvision.datasets.utils import download_url
import impact.config
@@ -99,7 +98,7 @@ try:
if not os.path.exists(os.path.join(sam_path, "sam_vit_b_01ec64.pth")):
download_url("https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth", sam_path)
except:
print(f"[Impact Pack] Failed to auto-download model files. Please download them manually.")
print("[Impact Pack] Failed to auto-download model files. Please download them manually.")
if not os.path.exists(onnx_path):
print(f"### ComfyUI-Impact-Pack: onnx model directory created ({onnx_path})")
@@ -108,18 +107,21 @@ try:
impact.config.write_config()
# Remove legacy subpack
subpack_path = os.path.join(os.path.dirname(__file__), 'impact_subpack')
if os.path.exists(subpack_path):
shutil.rmtree(subpack_path)
print(f"Legacy subpack is detected. '{subpack_path}' is removed.")
subpack_path = os.path.join(os.path.dirname(__file__), 'subpack')
if os.path.exists(subpack_path):
shutil.rmtree(subpack_path)
print(f"Legacy subpack is detected. '{subpack_path}' is removed.")
try:
subpack_path = os.path.join(os.path.dirname(__file__), 'impact_subpack')
if os.path.exists(subpack_path):
shutil.rmtree(subpack_path)
print(f"Legacy subpack is detected. '{subpack_path}' is removed.")
subpack_path = os.path.join(os.path.dirname(__file__), 'subpack')
if os.path.exists(subpack_path):
shutil.rmtree(subpack_path)
print(f"Legacy subpack is detected. '{subpack_path}' is removed.")
except:
print(f"ERROT: Failed to delete legacy subpack '{subpack_path}'\nPlease delete the folder after terminate ComfyUI.")
install()
except Exception as e:
except Exception:
print("[ERROR] ComfyUI-Impact-Pack: Dependency installation has failed. Please install manually.")
traceback.print_exc()
+42
View File
@@ -3,6 +3,48 @@ import { app } from "../../scripts/app.js";
let original_show = app.ui.dialog.show;
export function customAlert(message) {
try {
app.extensionManager.toast.addAlert(message);
}
catch {
alert(message);
}
}
export function isBeforeFrontendVersion(compareVersion) {
try {
const frontendVersion = window['__COMFYUI_FRONTEND_VERSION__'];
if (typeof frontendVersion !== 'string') {
return false;
}
function parseVersion(versionString) {
const parts = versionString.split('.').map(Number);
return parts.length === 3 && parts.every(part => !isNaN(part)) ? parts : null;
}
const currentVersion = parseVersion(frontendVersion);
const comparisonVersion = parseVersion(compareVersion);
if (!currentVersion || !comparisonVersion) {
return false;
}
for (let i = 0; i < 3; i++) {
if (currentVersion[i] > comparisonVersion[i]) {
return false;
} else if (currentVersion[i] < comparisonVersion[i]) {
return true;
}
}
return false;
} catch {
return true;
}
}
function dialog_show_wrapper(html) {
if (typeof html === "string") {
if(html.includes("IMPACT-PACK-SIGNAL: STOP CONTROL BRIDGE")) {
+123 -71
View File
@@ -1,6 +1,13 @@
import { ComfyApp, app } from "../../scripts/app.js";
import { ComfyDialog, $el } from "../../scripts/ui.js";
import { api } from "../../scripts/api.js";
import { customAlert, isBeforeFrontendVersion } from "./common.js";
const is_legacy_front = () => isBeforeFrontendVersion('1.16.9');
if(is_legacy_front()) {
customAlert("An outdated version(<1.16.9) of the `comfyui-frontend-package` is installed. It is not compatible with the current version of the Impact Pack.");
}
let wildcards_list = [];
async function load_wildcards() {
@@ -223,29 +230,29 @@ api.addEventListener("executed", progressExecuteHandler);
app.registerExtension({
name: "Comfy.Impack",
commands: [
{
id: 'refresh-impact-wildcard',
label: 'Impact: Refresh Wildcard',
function: async () => {
await api.fetchApi('/impact/wildcards/refresh');
await load_wildcards();
app.extensionManager.toast.add({
severity: 'info',
summary: 'Refreshed!',
detail: 'Impact Wildcard List is refreshed!!',
life: 3000
});
}
}
],
commands: [
{
id: 'refresh-impact-wildcard',
label: 'Impact: Refresh Wildcard',
function: async () => {
await api.fetchApi('/impact/wildcards/refresh');
await load_wildcards();
app.extensionManager.toast.add({
severity: 'info',
summary: 'Refreshed!',
detail: 'Impact Wildcard List is refreshed!!',
life: 3000
});
}
}
],
menuCommands: [
{
path: ['Edit'],
commands: ['refresh-impact-wildcard']
}
],
menuCommands: [
{
path: ['Edit'],
commands: ['refresh-impact-wildcard']
}
],
loadedGraphNode(node, app) {
if (node.comfyClass == "MaskPainter") {
@@ -324,6 +331,32 @@ app.registerExtension({
}
}
if(nodeData.name == "ImpactSelectNthItemOfAnyList") {
const onConnectionsChange = nodeType.prototype.onConnectionsChange;
nodeType.prototype.onConnectionsChange = function (type, index, connected, link_info) {
if(!link_info || this.inputs[0].type != '*')
return;
if(index >= 2)
return;
// assign type
let slot_type = '*';
if(type == 2) {
slot_type = link_info.type;
}
else {
const node = app.graph.getNodeById(link_info.origin_id);
slot_type = node.outputs[link_info.origin_slot].type;
}
this.inputs[0].type = slot_type;
this.outputs[0].type = slot_type;
this.outputs[0].label = slot_type;
}
}
if(nodeData.name === 'ImpactInversedSwitch') {
nodeData.output = ['*'];
nodeData.output_is_list = [false];
@@ -337,12 +370,12 @@ app.registerExtension({
if(type == 2) {
// connect output
if(connected){
if(app.graph._nodes_by_id[link_info.target_id].type == 'Reroute') {
if(app.graph._nodes_by_id[link_info.target_id]?.type == 'Reroute') {
app.graph._nodes_by_id[link_info.target_id].disconnectInput(link_info.target_slot);
}
if(this.outputs[0].type == '*'){
if(link_info.type == '*') {
if(link_info.type == '*' && app.graph.getNodeById(link_info.target_id).slots[link_info.target_slot].type != '*') {
app.graph._nodes_by_id[link_info.target_id].disconnectInput(link_info.target_slot);
}
else {
@@ -359,7 +392,7 @@ app.registerExtension({
}
}
else {
if(app.graph._nodes_by_id[link_info.origin_id].type == 'Reroute')
if(app.graph._nodes_by_id[link_info.origin_id]?.type == 'Reroute')
this.disconnectInput(link_info.target_slot);
// connect input
@@ -371,7 +404,7 @@ app.registerExtension({
return; // fallback
}
if(origin_type == '*') {
if(origin_type == '*' && app.graph.getNodeById(link_info.origin_id).slots[link_info.origin_slot].type != '*') {
this.disconnectInput(link_info.target_slot);
return;
}
@@ -395,20 +428,27 @@ app.registerExtension({
!stackTrace.includes('LGraphNode.prototype.connect') && // for touch device
!stackTrace.includes('LGraphNode.connect') && // for mouse device
!stackTrace.includes('loadGraphData')) {
if(this.outputs[link_info.origin_slot].links.length == 0)
if(this.outputs[link_info.origin_slot].links.length == 0) {
this.removeOutput(link_info.origin_slot);
}
}
}
let slot_i = 1;
for (let i = 0; i < this.outputs.length; i++) {
this.outputs[i].name = `output${slot_i}`
if (this.outputs[i].slot_index === undefined) {
this.outputs[i].slot_index = i;
}
slot_i++;
}
let last_slot = this.outputs[this.outputs.length - 1];
if (last_slot.slot_index == link_info.origin_slot) {
this.addOutput(`output${slot_i}`, this.outputs[0].type);
if(connected) {
// NOTE: node.slot_index is different with link_info.origin_slot
let last_slot_index = this.outputs.length - 1;
if (last_slot_index == link_info.origin_slot) {
this.addOutput(`output${slot_i}`, this.outputs[0].type);
}
}
let select_slot = this.inputs.find(x => x.name == "select");
@@ -471,6 +511,23 @@ app.registerExtension({
const onConnectionsChange = nodeType.prototype.onConnectionsChange;
nodeType.prototype.onConnectionsChange = function (type, index, connected, link_info) {
const stackTrace = new Error().stack;
if(stackTrace.includes('loadGraphData')) {
if(this.widgets?.[0]) {
this.widgets[0].options.max = this.inputs.length-3;
this.widgets[0].value = Math.min(this.widgets[0].value, this.widgets[0].options.max);
}
return;
}
if(stackTrace.includes('pasteFromClipboard')) {
if(this.widgets?.[0]) {
this.widgets[0].options.max = this.inputs.length-3;
this.widgets[0].value = Math.min(this.widgets[0].value, this.widgets[0].options.max);
}
return;
}
if(!link_info)
return;
@@ -482,7 +539,7 @@ app.registerExtension({
}
if(this.outputs[0].type == '*'){
if(link_info.type == '*') {
if(link_info.type == '*' && app.graph.getNodeById(link_info.target_id).slots[link_info.target_slot].type != '*') {
app.graph._nodes_by_id[link_info.target_id].disconnectInput(link_info.target_slot);
}
else {
@@ -513,12 +570,12 @@ app.registerExtension({
if(this.inputs[0].type == '*'){
const node = app.graph.getNodeById(link_info.origin_id);
let origin_type = node.outputs[link_info.origin_slot]?.type;
if(link_info.target_slot == 0 && this.inputs.length > 1) {
if(link_info.target_slot == 0 && this.inputs.length > 3) { // NOTE: widgets are regarded as input since new front
origin_type = this.inputs[1].type;
node.connect(link_info.origin_slot, node.id, 'input1');
}
if(origin_type == '*') {
if(origin_type == '*' && app.graph.getNodeById(link_info.origin_id).slots[link_info.origin_slot].type != '*') {
this.disconnectInput(link_info.target_slot);
return;
}
@@ -536,15 +593,8 @@ app.registerExtension({
}
let select_slot = this.inputs.find(x => x.name == "select");
let mode_slot = this.inputs.find(x => x.name == "sel_mode");
let converted_count = 0;
converted_count += select_slot?1:0;
converted_count += mode_slot?1:0;
if (!connected && (this.inputs.length > 1+converted_count)) {
const stackTrace = new Error().stack;
if (!connected && (this.inputs.length > 3)) {
if(
!stackTrace.includes('LGraphNode.prototype.connect') && // for touch device
!stackTrace.includes('LGraphNode.connect') && // for mouse device
@@ -554,6 +604,7 @@ app.registerExtension({
}
}
let slot_i = 1;
for (let i = 0; i < this.inputs.length; i++) {
let input_i = this.inputs[i];
@@ -563,18 +614,13 @@ app.registerExtension({
}
}
let last_slot = this.inputs[this.inputs.length - 1];
if (
(last_slot.name == 'select' && last_slot.name != 'sel_mode' && this.inputs[this.inputs.length - 2].link != undefined)
|| (last_slot.name != 'select' && last_slot.name != 'sel_mode' && last_slot.link != undefined)) {
this.addInput(`${input_name}${slot_i}`, this.outputs[0].type);
if(connected) {
this.addInput(`${input_name}${slot_i}`, this.outputs[0].type);
}
if(this.widgets?.length) {
this.widgets[0].options.max = select_slot?this.inputs.length-1:this.inputs.length;
if(this.widgets?.[0]) {
this.widgets[0].options.max = this.inputs.length-3;
this.widgets[0].value = Math.min(this.widgets[0].value, this.widgets[0].options.max);
if(this.widgets[0].options.max > 0 && this.widgets[0].value == 0)
this.widgets[0].value = 1;
}
}
}
@@ -617,12 +663,14 @@ app.registerExtension({
if(node.comfyClass == "ImpactSEGSLabelFilter" || node.comfyClass == "SEGSLabelFilterDetailerHookProvider") {
node.widgets[0].callback = (value, canvas, node, pos, e) => {
if(node.widgets[1].value.trim() != "" && !node.widgets[1].value.trim().endsWith(","))
node.widgets[1].value += ", "
if(node) {
if(node.widgets[1].value.trim() != "" && !node.widgets[1].value.trim().endsWith(","))
node.widgets[1].value += ", "
node.widgets[1].value += value;
if(node.widgets_values)
node.widgets_values[1] = node.widgets[1].value;
node.widgets[1].value += value;
if(node.widgets_values)
node.widgets_values[1] = node.widgets[1].value;
}
}
Object.defineProperty(node.widgets[0], "value", {
@@ -696,18 +744,20 @@ app.registerExtension({
break;
}
node.widgets[combo_id+1].callback = (value, canvas, node, pos, e) => {
if(node.widgets[tbox_id].value != '')
node.widgets[tbox_id].value += ', '
node.widgets[combo_id+1].callback = (value, canvas, node, pos, e) => {
if(node) {
if(node.widgets[tbox_id].value != '')
node.widgets[tbox_id].value += ', '
node.widgets[tbox_id].value += node._wildcard_value;
}
node.widgets[tbox_id].value += node._wildcard_value;
}
}
Object.defineProperty(node.widgets[combo_id+1], "value", {
set: (value) => {
if (value !== "Select the Wildcard to add to the text")
node._wildcard_value = value;
},
if (value !== "Select the Wildcard to add to the text")
node._wildcard_value = value;
},
get: () => { return "Select the Wildcard to add to the text"; }
});
@@ -720,14 +770,16 @@ app.registerExtension({
if(has_lora) {
node.widgets[combo_id].callback = (value, canvas, node, pos, e) => {
let lora_name = node._value;
if(lora_name.endsWith('.safetensors')) {
lora_name = lora_name.slice(0, -12);
}
if(node) {
let lora_name = node._value;
if(lora_name.endsWith('.safetensors')) {
lora_name = lora_name.slice(0, -12);
}
node.widgets[tbox_id].value += `<lora:${lora_name}>`;
if(node.widgets_values) {
node.widgets_values[tbox_id] = node.widgets[tbox_id].value;
node.widgets[tbox_id].value += `<lora:${lora_name}>`;
if(node.widgets_values) {
node.widgets_values[tbox_id] = node.widgets[tbox_id].value;
}
}
}
@@ -766,7 +818,7 @@ app.registerExtension({
else
node._mode_value = value; // combo value
populated_text_widget.inputEl.disabled = node._mode_value != 'populate';
populated_text_widget.inputEl.disabled = node._mode_value == 'populate';
},
get: () => {
if(node._mode_value != undefined)
File diff suppressed because it is too large Load Diff
+4
View File
@@ -45,6 +45,8 @@ class SEGSDetailerForAnimateDiff:
CATEGORY = "ImpactPack/Detailer"
DESCRIPTION = "This node enhances details by inpainting each region within the detected area bundle (SEGS) after enlarging them based on the guide size.\nThis node is applied specifically to SEGS rather than the entire image. To apply it to the entire image, use the 'SEGS Paste' node.\nAs a specialized detailer node for improving video details, such as in AnimateDiff, this node can handle cases where the masks contained in SEGS serve as batch masks spanning multiple frames."
@staticmethod
def do_detail(image_frames, segs, guide_size, guide_size_for, max_size, seed, steps, cfg, sampler_name, scheduler,
denoise, basic_pipe, refiner_ratio=None, refiner_basic_pipe_opt=None, noise_mask_feather=0, scheduler_func_opt=None):
@@ -166,6 +168,8 @@ class DetailerForEachPipeForAnimateDiff:
CATEGORY = "ImpactPack/Detailer"
DESCRIPTION = "This node enhances details by inpainting each region within the detected area bundle (SEGS) after enlarging them based on the guide size.\nThis node is a specialized detailer node for enhancing video details, such as in AnimateDiff. It can handle cases where the masks contained in SEGS serve as batch masks spanning multiple frames."
@staticmethod
def doit(image_frames, segs, guide_size, guide_size_for, max_size, seed, steps, cfg, sampler_name, scheduler,
denoise, feather, basic_pipe, refiner_ratio=None, detailer_hook=None, refiner_basic_pipe_opt=None,
+1 -1
View File
@@ -1,7 +1,7 @@
import configparser
import os
version_code = [8, 6]
version_code = [8, 17, 1]
version = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
dependency_version = 24
+65 -49
View File
@@ -48,7 +48,7 @@ preview_bridge_last_mask_cache = {}
current_prompt = None
SCHEDULERS = comfy.samplers.KSampler.SCHEDULERS + ['AYS SDXL', 'AYS SD1', 'AYS SVD', 'GITS[coeff=1.2]', 'LTXV[default]']
SCHEDULERS = comfy.samplers.KSampler.SCHEDULERS + ['AYS SDXL', 'AYS SD1', 'AYS SVD', 'GITS[coeff=1.2]', 'LTXV[default]', 'OSS FLUX', 'OSS Wan']
def is_execution_model_version_supported():
@@ -320,6 +320,9 @@ def enhance_detail(image, model, clip, vae, guide_size, guide_size_for_bbox, max
# upscale
upscaled_image = tensor_resize(image, new_w, new_h)
if detailer_hook is not None:
upscaled_image = detailer_hook.post_upscale(upscaled_image, noise_mask)
cnet_pils = None
if control_net_wrapper is not None:
positive, negative, cnet_pils = control_net_wrapper.apply(positive, negative, upscaled_image, noise_mask)
@@ -327,61 +330,69 @@ def enhance_detail(image, model, clip, vae, guide_size, guide_size_for_bbox, max
cnet_pils.extend(cnet_pils2)
# prepare mask
if noise_mask is not None and inpaint_model:
imc_encode = nodes.InpaintModelConditioning().encode
if 'noise_mask' in inspect.signature(imc_encode).parameters:
positive, negative, latent_image = imc_encode(positive, negative, upscaled_image, vae, mask=noise_mask, noise_mask=True)
if detailer_hook is None or not detailer_hook.get_skip_sampling():
if noise_mask is not None and inpaint_model:
imc_encode = nodes.InpaintModelConditioning().encode
if 'noise_mask' in inspect.signature(imc_encode).parameters:
positive, negative, latent_image = imc_encode(positive, negative, upscaled_image, vae, mask=noise_mask, noise_mask=True)
else:
print(f"[Impact Pack] ComfyUI is an outdated version.")
positive, negative, latent_image = imc_encode(positive, negative, upscaled_image, vae, noise_mask)
else:
print(f"[Impact Pack] ComfyUI is an outdated version.")
positive, negative, latent_image = imc_encode(positive, negative, upscaled_image, vae, noise_mask)
else:
latent_image = to_latent_image(upscaled_image, vae, vae_tiled_encode=vae_tiled_encode)
if noise_mask is not None:
latent_image['noise_mask'] = noise_mask
latent_image = to_latent_image(upscaled_image, vae, vae_tiled_encode=vae_tiled_encode)
if noise_mask is not None:
latent_image['noise_mask'] = noise_mask
if detailer_hook is not None:
latent_image = detailer_hook.post_encode(latent_image)
refined_latent = latent_image
# ksampler
for i in range(0, cycle):
if detailer_hook is not None:
latent_image = detailer_hook.post_encode(latent_image)
refined_latent = latent_image
sampler_opt=None
if detailer_hook is not None:
sampler_opt = detailer_hook.get_custom_sampler()
# ksampler
for i in range(0, cycle):
if detailer_hook is not None:
detailer_hook.set_steps((i, cycle))
if detailer_hook is not None:
detailer_hook.set_steps((i, cycle))
refined_latent = detailer_hook.cycle_latent(refined_latent)
refined_latent = detailer_hook.cycle_latent(refined_latent)
model2, seed2, steps2, cfg2, sampler_name2, scheduler2, positive2, negative2, upscaled_latent2, denoise2 = \
detailer_hook.pre_ksample(model, seed+i, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise)
noise, is_touched = detailer_hook.get_custom_noise(seed+i, torch.zeros(latent_image['samples'].size()), is_touched=False)
if not is_touched:
model2, seed2, steps2, cfg2, sampler_name2, scheduler2, positive2, negative2, upscaled_latent2, denoise2 = \
detailer_hook.pre_ksample(model, seed+i, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise)
noise, is_touched = detailer_hook.get_custom_noise(seed+i, torch.zeros(latent_image['samples'].size()), is_touched=False)
if not is_touched:
noise = None
else:
model2, seed2, steps2, cfg2, sampler_name2, scheduler2, positive2, negative2, upscaled_latent2, denoise2 = \
model, seed + i, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise
noise = None
refined_latent = impact_sampling.ksampler_wrapper(model2, seed2, steps2, cfg2, sampler_name2, scheduler2, positive2, negative2,
refined_latent, denoise2, refiner_ratio, refiner_model, refiner_clip, refiner_positive, refiner_negative,
noise=noise, scheduler_func=scheduler_func, sampler_opt=sampler_opt)
if detailer_hook is not None:
refined_latent = detailer_hook.pre_decode(refined_latent)
# non-latent downscale - latent downscale cause bad quality
start = time.time()
if vae_tiled_decode:
(refined_image,) = nodes.VAEDecodeTiled().decode(vae, refined_latent, 512) # using default settings
print(f"[Impact Pack] vae decoded (tiled) in {time.time() - start:.1f}s")
else:
model2, seed2, steps2, cfg2, sampler_name2, scheduler2, positive2, negative2, upscaled_latent2, denoise2 = \
model, seed + i, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise
noise = None
refined_latent = impact_sampling.ksampler_wrapper(model2, seed2, steps2, cfg2, sampler_name2, scheduler2, positive2, negative2,
refined_latent, denoise2, refiner_ratio, refiner_model, refiner_clip, refiner_positive, refiner_negative,
noise=noise, scheduler_func=scheduler_func)
if detailer_hook is not None:
refined_latent = detailer_hook.pre_decode(refined_latent)
# non-latent downscale - latent downscale cause bad quality
start = time.time()
if vae_tiled_decode:
(refined_image,) = nodes.VAEDecodeTiled().decode(vae, refined_latent, 512) # using default settings
print(f"[Impact Pack] vae decoded (tiled) in {time.time() - start:.1f}s")
try:
refined_image = vae.decode(refined_latent['samples'])
except Exception as e:
# usually an out-of-memory exception from the decode, so try a tiled approach
print(f"[Impact Pack] failed after {time.time() - start:.1f}s, doing vae.decode_tiled 64...")
refined_image = vae.decode_tiled(refined_latent["samples"], tile_x=64, tile_y=64, )
print(f"[Impact Pack] vae decoded in {time.time() - start:.1f}s")
else:
try:
refined_image = vae.decode(refined_latent['samples'])
except Exception as e:
# usually an out-of-memory exception from the decode, so try a tiled approach
print(f"[Impact Pack] failed after {time.time() - start:.1f}s, doing vae.decode_tiled 64...")
refined_image = vae.decode_tiled(refined_latent["samples"], tile_x=64, tile_y=64, )
print(f"[Impact Pack] vae decoded in {time.time() - start:.1f}s")
# skipped
refined_image = upscaled_image
if detailer_hook is not None:
refined_image = detailer_hook.post_decode(refined_image)
@@ -513,11 +524,16 @@ def enhance_detail_for_animatediff(image_frames, model, clip, vae, guide_size, g
'samples': latent_frames
}
sampler_opt=None
if detailer_hook is not None:
sampler_opt = detailer_hook.get_custom_sampler()
if detailer_hook is not None:
latent = detailer_hook.post_encode(latent)
refined_latent = impact_sampling.ksampler_wrapper(model, seed, steps, cfg, sampler_name, scheduler, positive, negative,
latent, denoise, refiner_ratio, refiner_model, refiner_clip, refiner_positive, refiner_negative, scheduler_func=scheduler_func)
latent, denoise, refiner_ratio, refiner_model, refiner_clip, refiner_positive, refiner_negative, scheduler_func=scheduler_func, sampler_opt=sampler_opt)
if detailer_hook is not None:
refined_latent = detailer_hook.pre_decode(refined_latent)
@@ -1077,7 +1093,7 @@ class ONNXDetector:
def detect(self, image, threshold, dilation, crop_factor, drop_size=1, detailer_hook=None):
drop_size = max(drop_size, 1)
try:
import impact.onnx as onnx
import impact.impact_onnx as onnx
h = image.shape[1]
w = image.shape[2]
+2 -2
View File
@@ -163,7 +163,7 @@ class SegmDetectorCombined:
mask = segm_detector.detect_combined(image, threshold, dilation)
if mask is None:
mask = torch.zeros((image.shape[2], image.shape[1]), dtype=torch.float32, device="cpu")
mask = torch.zeros((image.shape[1], image.shape[2]), dtype=torch.float32, device="cpu")
return (mask.unsqueeze(0),)
@@ -183,7 +183,7 @@ class BboxDetectorCombined(SegmDetectorCombined):
mask = bbox_detector.detect_combined(image, threshold, dilation)
if mask is None:
mask = torch.zeros((image.shape[2], image.shape[1]), dtype=torch.float32, device="cpu")
mask = torch.zeros((image.shape[1], image.shape[2]), dtype=torch.float32, device="cpu")
return (mask.unsqueeze(0),)
+23
View File
@@ -1,6 +1,8 @@
import sys
from . import hooks
from . import defs
from . import utils
import nodes
class SEGSOrderedFilterDetailerHookProvider:
@@ -83,3 +85,24 @@ class PreviewDetailerHookProvider:
def doit(self, quality, unique_id):
hook = hooks.PreviewDetailerHook(unique_id, quality)
return hook, hook
class LamaRemoverDetailerHookProvider:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"mask_threshold":("INT", {"default": 250, "min": 0, "max": 255, "step": 1, "display": "slider"}),
"gaussblur_radius": ("INT", {"default": 8, "min": 0, "max": 20, "step": 1, "display": "slider"}),
"skip_sampling": ("BOOLEAN", {"default": True}),
}
}
RETURN_TYPES = ("DETAILER_HOOK", )
FUNCTION = "doit"
CATEGORY = "ImpactPack/Util"
def doit(self, mask_threshold, gaussblur_radius, skip_sampling):
hook = hooks.LamaRemoverDetailerHook(mask_threshold, gaussblur_radius, skip_sampling)
return (hook, )
+48 -3
View File
@@ -25,7 +25,7 @@ class PixelKSampleHook:
def post_decode(self, pixels):
return pixels
def post_upscale(self, pixels):
def post_upscale(self, pixels, mask=None):
return pixels
def post_encode(self, samples):
@@ -64,8 +64,8 @@ class PixelKSampleHookCombine(PixelKSampleHook):
def post_decode(self, pixels):
return self.hook2.post_decode(self.hook1.post_decode(pixels))
def post_upscale(self, pixels):
return self.hook2.post_upscale(self.hook1.post_upscale(pixels))
def post_upscale(self, pixels, mask=None):
return self.hook2.post_upscale(self.hook1.post_upscale(pixels, mask), mask)
def post_encode(self, samples):
return self.hook2.post_encode(self.hook1.post_encode(samples))
@@ -109,6 +109,15 @@ class DetailerHookCombine(PixelKSampleHookCombine):
noise_2nd, is_touched = self.hook2.get_custom_noise(seed, noise, is_touched)
return noise, is_touched
def get_custom_sampler(self):
if self.hook1.get_custom_sampler() is not None:
return self.hook1.get_custom_sampler()
else:
return self.hook2.get_custom_sampler()
def get_skip_sampling(self):
return self.hook1.get_skip_sampling() and self.hook2.get_skip_sampling()
class SimpleCfgScheduleHook(PixelKSampleHook):
target_cfg = 0
@@ -173,6 +182,21 @@ class DetailerHook(PixelKSampleHook):
def get_custom_noise(self, seed, noise, is_touched):
return noise, is_touched
def get_custom_sampler(self):
return None
def get_skip_sampling(self):
return False
class CustomSamplerDetailerHookProvider(DetailerHook):
def __init__(self, sampler):
super().__init__()
self.sampler = sampler
def get_custom_sampler(self):
return self.sampler
# class CustomNoiseDetailerHookProvider(DetailerHook):
# def __init__(self, noise):
@@ -486,6 +510,27 @@ class SEGSLabelFilterDetailerHook(DetailerHook):
return segs_nodes.SEGSLabelFilter().doit(segs, "", self.labels)[0]
class LamaRemoverDetailerHook(DetailerHook):
def __init__(self, mask_threshold, gaussblur_radius, skip_sampling):
super().__init__()
self.mask_threshold = mask_threshold
self.gaussblur_radius = gaussblur_radius
self.skip_sampling = skip_sampling
def post_upscale(self, img, mask=None):
if "LamaRemover" in nodes.NODE_CLASS_MAPPINGS:
lama_remover_obj = nodes.NODE_CLASS_MAPPINGS['LamaRemover']()
else:
utils.try_install_custom_node('https://github.com/Layer-norm/comfyui-lama-remover',
"To use 'LAMARemoverDetailerHookProvider', 'comfyui-lama-remover' nodepack is required.")
raise Exception("'LamaRemover' node is not installed.")
return lama_remover_obj.lama_remover(img, masks=mask, mask_threshold=self.mask_threshold, gaussblur_radius=self.gaussblur_radius, invert_mask=False)[0]
def get_skip_sampling(self):
return self.skip_sampling
class PreviewDetailerHook(DetailerHook):
def __init__(self, node_id, quality):
super().__init__()
+41 -4
View File
@@ -96,9 +96,13 @@ class SAMLoader:
@classmethod
def INPUT_TYPES(cls):
models = [x for x in folder_paths.get_filename_list("sams") if 'hq' not in x]
if 'ESAM_ModelLoader_Zho' in nodes.NODE_CLASS_MAPPINGS:
models.append('ESAM')
return {
"required": {
"model_name": (models + ['ESAM'], {"tooltip": "The detection accuracy varies depending on the SAM model. ESAM can only be used if ComfyUI-YoloWorld-EfficientSAM is installed."}),
"model_name": (models, {"tooltip": "The detection accuracy varies depending on the SAM model. ESAM can only be used if ComfyUI-YoloWorld-EfficientSAM is installed."}),
"device_mode": (["AUTO", "Prefer GPU", "CPU"], {"tooltip": "AUTO: Only applicable when a GPU is available. It temporarily loads the SAM_MODEL into VRAM only when the detection function is used.\n"
"Prefer GPU: Tries to keep the SAM_MODEL on the GPU whenever possible. This can be used when there is sufficient VRAM available.\n"
"CPU: Always loads only on the CPU."}),
@@ -228,6 +232,8 @@ class DetailerForEach:
CATEGORY = "ImpactPack/Detailer"
DESCRIPTION = "It enhances details by inpainting each region within the detected area bundle (SEGS) after enlarging them based on the guide size."
@staticmethod
def get_core_module():
return core
@@ -442,6 +448,8 @@ class DetailerForEachPipe:
CATEGORY = "ImpactPack/Detailer"
DESCRIPTION = DetailerForEach.DESCRIPTION
def doit(self, image, segs, guide_size, guide_size_for, max_size, seed, steps, cfg, sampler_name, scheduler,
denoise, feather, noise_mask, force_inpaint, basic_pipe, wildcard,
refiner_ratio=None, detailer_hook=None, refiner_basic_pipe_opt=None,
@@ -533,6 +541,8 @@ class FaceDetailer:
CATEGORY = "ImpactPack/Simple"
DESCRIPTION = "This node enhances details by automatically detecting specific objects in the input image using detection models (bbox, segm, sam) and regenerating the image by enlarging the detected area based on the guide size.\nAlthough this node is specialized to simplify the commonly used facial detail enhancement workflow, it can also be used for various automatic inpainting purposes depending on the detection model."
@staticmethod
def enhance_face(image, model, clip, vae, guide_size, guide_size_for_bbox, max_size, seed, steps, cfg, sampler_name, scheduler,
positive, negative, denoise, feather, noise_mask, force_inpaint,
@@ -801,6 +811,26 @@ class CoreMLDetailerHookProvider:
return (hook, )
class CustomSamplerDetailerHookProvider:
@classmethod
def INPUT_TYPES(s):
return {"required": {
"sampler": ("SAMPLER", ),
},
}
RETURN_TYPES = ("DETAILER_HOOK",)
FUNCTION = "doit"
CATEGORY = "ImpactPack/Detailer"
DESCRIPTION = "Apply a hook that allows you to use a custom sampler in the Detailer nodes. When using `DetailerHookCombine`, the sampler from the first hook is applied."
def doit(self, sampler):
hook = hooks.CustomSamplerDetailerHookProvider(sampler)
return (hook, )
class CfgScheduleHookProvider:
schedules = ["simple"]
@@ -1407,6 +1437,8 @@ class FaceDetailerPipe:
CATEGORY = "ImpactPack/Simple"
DESCRIPTION = FaceDetailer.DESCRIPTION
def doit(self, image, detailer_pipe, guide_size, guide_size_for, max_size, seed, steps, cfg, sampler_name, scheduler,
denoise, feather, noise_mask, force_inpaint, bbox_threshold, bbox_dilation, bbox_crop_factor,
sam_detection_hint, sam_dilation, sam_threshold, sam_bbox_expansion,
@@ -1502,6 +1534,8 @@ class MaskDetailerPipe:
CATEGORY = "ImpactPack/Detailer"
DESCRIPTION = ""
def doit(self, image, mask, basic_pipe, guide_size, guide_size_for, max_size, mask_mode,
seed, steps, cfg, sampler_name, scheduler, denoise,
feather, crop_factor, drop_size, refiner_ratio, batch_size, cycle=1,
@@ -1607,6 +1641,8 @@ class DetailerForEachTestPipe(DetailerForEachPipe):
CATEGORY = "ImpactPack/Detailer"
DESCRIPTION = DetailerForEach.DESCRIPTION
def doit(self, image, segs, guide_size, guide_size_for, max_size, seed, steps, cfg, sampler_name, scheduler,
denoise, feather, noise_mask, force_inpaint, basic_pipe, wildcard, cycle=1,
refiner_ratio=None, detailer_hook=None, refiner_basic_pipe_opt=None, inpaint_model=False, noise_mask_feather=0,
@@ -1890,7 +1926,7 @@ class MaskRectArea:
# search for node
node_found = False
for node in extra_pnginfo["workflow"]["nodes"]:
if node["id"] == int(unique_id):
if str(node["id"]) == unique_id:
min_x = node["properties"].get("x", 0) / 100
min_y = node["properties"].get("y", 0) / 100
width = node["properties"].get("w", 0) / 100
@@ -2343,7 +2379,7 @@ class ImpactWildcardProcessor:
return {"required": {
"wildcard_text": ("STRING", {"multiline": True, "dynamicPrompts": False, "tooltip": "Enter a prompt using wildcard syntax."}),
"populated_text": ("STRING", {"multiline": True, "dynamicPrompts": False, "tooltip": "The actual value passed during the execution of 'ImpactWildcardProcessor' is what is shown here. The behavior varies slightly depending on the mode. Wildcard syntax can also be used in 'populated_text'."}),
"mode": (["populate", "fixed", "reproduce"], {"default": "populate", "tooltip":
"mode": (["populate", "fixed", "reproduce"], {"default": "populate", "tooltip":
"populate: Before running the workflow, it overwrites the existing value of 'populated_text' with the prompt processed from 'wildcard_text'. In this mode, 'populated_text' cannot be edited.\n"
"fixed: Ignores wildcard_text and keeps 'populated_text' as is. You can edit 'populated_text' in this mode.\n"
"reproduce: This mode operates as 'fixed' mode only once for reproduction, and then it switches to 'populate' mode."
@@ -2359,6 +2395,7 @@ class ImpactWildcardProcessor:
"TIP: Before the workflow is executed, the processing result of 'wildcard_text' is displayed in 'populated_text', and the populated text is saved along with the workflow. If you want to use a seed converted as input, write the prompt directly in 'populated_text' instead of 'wildcard_text', and set the mode to 'fixed'.")
RETURN_TYPES = ("STRING", )
RETURN_NAMES = ("processed text",)
FUNCTION = "doit"
@staticmethod
@@ -2418,7 +2455,7 @@ class ImpactSchedulerAdapter:
def INPUT_TYPES(s):
return {"required": {
"scheduler": (comfy.samplers.KSampler.SCHEDULERS, {"defaultInput": True, }),
"extra_scheduler": (['None', 'AYS SDXL', 'AYS SD1', 'AYS SVD', 'GITS[coeff=1.2]', 'LTXV[default]'],),
"extra_scheduler": (['None', 'AYS SDXL', 'AYS SD1', 'AYS SVD', 'GITS[coeff=1.2]', 'LTXV[default]', 'OSS FLUX', 'OSS Wan'],),
}}
CATEGORY = "ImpactPack/Util"
+24 -60
View File
@@ -29,6 +29,8 @@ def calculate_sigmas(model, sampler, scheduler, steps):
sigmas = nodes.NODE_CLASS_MAPPINGS['GITSScheduler']().get_sigmas(float(scheduler[11:-1]), steps, denoise=1.0)[0]
elif scheduler == 'LTXV[default]':
sigmas = nodes.NODE_CLASS_MAPPINGS['LTXVScheduler']().get_sigmas(20, 2.05, 0.95, True, 0.1)[0]
elif scheduler.startswith('OSS'):
sigmas = nodes.NODE_CLASS_MAPPINGS['OptimalStepsScheduler']().get_sigmas(scheduler[4:], steps, denoise=1.0)[0]
else:
sigmas = samplers.calculate_sigmas(model.get_model_object("model_sampling"), scheduler, steps)
@@ -46,65 +48,27 @@ def get_noise_sampler(x, cpu, total_sigmas, **kwargs):
def ksampler(sampler_name, total_sigmas, extra_options={}, inpaint_options={}):
if sampler_name == "dpmpp_sde":
def sample_dpmpp_sde(model, x, sigmas, **kwargs):
noise_sampler = get_noise_sampler(x, True, total_sigmas, **kwargs)
if noise_sampler is not None:
kwargs['noise_sampler'] = noise_sampler
if sampler_name in ["dpmpp_sde", "dpmpp_sde_gpu", "dpmpp_2m_sde", "dpmpp_2m_sde_gpu", "dpmpp_3m_sde", "dpmpp_3m_sde_gpu"]:
if sampler_name == "dpmpp_sde":
orig_sampler_function = k_diffusion_sampling.sample_dpmpp_sde
elif sampler_name == "dpmpp_sde_gpu":
orig_sampler_function = k_diffusion_sampling.sample_dpmpp_sde_gpu
elif sampler_name == "dpmpp_2m_sde":
orig_sampler_function = k_diffusion_sampling.sample_dpmpp_2m_sde
elif sampler_name == "dpmpp_2m_sde_gpu":
orig_sampler_function = k_diffusion_sampling.sample_dpmpp_2m_sde_gpu
elif sampler_name == "dpmpp_3m_sde":
orig_sampler_function = k_diffusion_sampling.sample_dpmpp_3m_sde
elif sampler_name == "dpmpp_3m_sde_gpu":
orig_sampler_function = k_diffusion_sampling.sample_dpmpp_3m_sde_gpu
return k_diffusion_sampling.sample_dpmpp_sde(model, x, sigmas, **kwargs)
def sampler_function_wrapper(model, x, sigmas, **kwargs):
if 'noise_sampler' not in kwargs:
kwargs['noise_sampler'] = get_noise_sampler(x, 'gpu' not in sampler_name, total_sigmas, **kwargs)
sampler_function = sample_dpmpp_sde
return orig_sampler_function(model, x, sigmas, **kwargs)
elif sampler_name == "dpmpp_sde_gpu":
def sample_dpmpp_sde(model, x, sigmas, **kwargs):
noise_sampler = get_noise_sampler(x, False, total_sigmas, **kwargs)
if noise_sampler is not None:
kwargs['noise_sampler'] = noise_sampler
return k_diffusion_sampling.sample_dpmpp_sde_gpu(model, x, sigmas, **kwargs)
sampler_function = sample_dpmpp_sde
elif sampler_name == "dpmpp_2m_sde":
def sample_dpmpp_sde(model, x, sigmas, **kwargs):
noise_sampler = get_noise_sampler(x, True, total_sigmas, **kwargs)
if noise_sampler is not None:
kwargs['noise_sampler'] = noise_sampler
return k_diffusion_sampling.sample_dpmpp_2m_sde(model, x, sigmas, **kwargs)
sampler_function = sample_dpmpp_sde
elif sampler_name == "dpmpp_2m_sde_gpu":
def sample_dpmpp_sde(model, x, sigmas, **kwargs):
noise_sampler = get_noise_sampler(x, False, total_sigmas, **kwargs)
if noise_sampler is not None:
kwargs['noise_sampler'] = noise_sampler
return k_diffusion_sampling.sample_dpmpp_2m_sde_gpu(model, x, sigmas, **kwargs)
sampler_function = sample_dpmpp_sde
elif sampler_name == "dpmpp_3m_sde":
def sample_dpmpp_sde(model, x, sigmas, **kwargs):
noise_sampler = get_noise_sampler(x, True, total_sigmas, **kwargs)
if noise_sampler is not None:
kwargs['noise_sampler'] = noise_sampler
return k_diffusion_sampling.sample_dpmpp_3m_sde(model, x, sigmas, **kwargs)
sampler_function = sample_dpmpp_sde
elif sampler_name == "dpmpp_3m_sde_gpu":
def sample_dpmpp_sde(model, x, sigmas, **kwargs):
noise_sampler = get_noise_sampler(x, False, total_sigmas, **kwargs)
if noise_sampler is not None:
kwargs['noise_sampler'] = noise_sampler
return k_diffusion_sampling.sample_dpmpp_3m_sde_gpu(model, x, sigmas, **kwargs)
sampler_function = sample_dpmpp_sde
sampler_function = sampler_function_wrapper
else:
return comfy.samplers.sampler_object(sampler_name)
@@ -230,7 +194,7 @@ def impact_sample(model, seed, steps, cfg, sampler_name, scheduler, positive, ne
def ksampler_wrapper(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise,
refiner_ratio=None, refiner_model=None, refiner_clip=None, refiner_positive=None, refiner_negative=None, sigma_factor=1.0, noise=None, scheduler_func=None):
refiner_ratio=None, refiner_model=None, refiner_clip=None, refiner_positive=None, refiner_negative=None, sigma_factor=1.0, noise=None, scheduler_func=None, sampler_opt=None):
if refiner_ratio is None or refiner_model is None or refiner_clip is None or refiner_positive is None or refiner_negative is None:
# Use separated_sample instead of KSampler for `AYS scheduler`
@@ -242,7 +206,7 @@ def ksampler_wrapper(model, seed, steps, cfg, sampler_name, scheduler, positive,
refined_latent = separated_sample(model, True, seed, advanced_steps, cfg, sampler_name, scheduler,
positive, negative, latent_image, start_at_step, end_at_step, False,
sigma_ratio=sigma_factor, noise=noise, scheduler_func=scheduler_func)
sigma_ratio=sigma_factor, sampler_opt=sampler_opt, noise=noise, scheduler_func=scheduler_func)
else:
advanced_steps = math.floor(steps / denoise)
start_at_step = advanced_steps - steps
@@ -251,7 +215,7 @@ def ksampler_wrapper(model, seed, steps, cfg, sampler_name, scheduler, positive,
# print(f"pre: {start_at_step} .. {end_at_step} / {advanced_steps}")
temp_latent = separated_sample(model, True, seed, advanced_steps, cfg, sampler_name, scheduler,
positive, negative, latent_image, start_at_step, end_at_step, True,
sigma_ratio=sigma_factor, noise=noise, scheduler_func=scheduler_func)
sigma_ratio=sigma_factor, sampler_opt=sampler_opt, noise=noise, scheduler_func=scheduler_func)
if 'noise_mask' in latent_image:
# noise_latent = \
@@ -265,7 +229,7 @@ def ksampler_wrapper(model, seed, steps, cfg, sampler_name, scheduler, positive,
# print(f"post: {end_at_step} .. {advanced_steps + 1} / {advanced_steps}")
refined_latent = separated_sample(refiner_model, False, seed, advanced_steps, cfg, sampler_name, scheduler,
refiner_positive, refiner_negative, temp_latent, end_at_step, advanced_steps + 1, False,
sigma_ratio=sigma_factor, scheduler_func=scheduler_func)
sigma_ratio=sigma_factor, sampler_opt=sampler_opt, scheduler_func=scheduler_func)
return refined_latent
+2 -3
View File
@@ -17,7 +17,6 @@ import numpy as np
import nodes
from PIL import Image
import io
import impact.wildcards as wildcards
import comfy
from io import BytesIO
import random
@@ -183,7 +182,7 @@ async def wildcards_list(request):
@PromptServer.instance.routes.post("/impact/wildcards")
async def populate_wildcards(request):
data = await request.json()
populated = wildcards.process(data['text'], data.get('seed', None))
populated = impact.wildcards.process(data['text'], data.get('seed', None))
return web.json_response({"text": populated})
@@ -512,7 +511,7 @@ def onprompt_populate_wildcards(json_data):
else:
input_seed = int(inputs['seed'])
inputs['populated_text'] = wildcards.process(inputs['wildcard_text'], input_seed)
inputs['populated_text'] = impact.wildcards.process(inputs['wildcard_text'], input_seed)
inputs['mode'] = 'reproduce'
PromptServer.instance.send_sync("impact-node-feedback", {"node_id": k, "widget_name": "populated_text", "type": "STRING", "value": inputs['populated_text']})
+4 -22
View File
@@ -8,7 +8,7 @@ from impact.utils import any_typ
import impact.core as core
import re
import nodes
import traceback
class ImpactCompare:
@classmethod
@@ -574,27 +574,6 @@ class ImpactSleep:
return (signal,)
error_skip_flag = False
try:
import cm_global
def filter_message(str):
global error_skip_flag
if "IMPACT-PACK-SIGNAL: STOP CONTROL BRIDGE" in str:
return True
elif error_skip_flag and "ERROR:root:!!! Exception during processing !!!\n" == str:
error_skip_flag = False
return True
else:
return False
cm_global.try_call(api='cm.register_message_collapse', f=filter_message)
except Exception as e:
print(f"[WARN] ComfyUI-Impact-Pack: `ComfyUI` or `ComfyUI-Manager` is an outdated version.")
pass
def workflow_to_map(workflow):
nodes = {}
links = {}
@@ -701,6 +680,9 @@ class ImpactControlBridge:
return (value, )
else:
return (ExecutionBlocker(None), )
elif extra_pnginfo is None:
logging.warn(f"[Impact Pack] limitation: '{behavior}' behavior cannot be used in API execution.")
return (value,)
else:
workflow_nodes, links = workflow_to_map(extra_pnginfo['workflow'])
-25
View File
@@ -1,25 +0,0 @@
import comfy.sample
import traceback
original_sample = comfy.sample.sample
def informative_sample(*args, **kwargs):
try:
return original_sample(*args, **kwargs) # This code helps interpret error messages that occur within exceptions but does not have any impact on other operations.
except RuntimeError as e:
is_model_mix_issue = False
try:
if 'mat1 and mat2 shapes cannot be multiplied' in e.args[0]:
if 'torch.nn.functional.linear' in traceback.format_exc().strip().split('\n')[-3]:
is_model_mix_issue = True
except:
pass
if is_model_mix_issue:
raise RuntimeError("\n\n#### It seems that models and clips are mixed and interconnected between SDXL Base, SDXL Refiner, SD1.x, and SD2.x. Please verify. ####\n\n")
else:
raise e
comfy.sample.sample = informative_sample
+141 -43
View File
@@ -13,6 +13,7 @@ from . import segs_upscaler
from comfy.cli_args import args
import math
from typing import Callable, Union
try:
from comfy_extras import nodes_differential_diffusion
@@ -60,6 +61,8 @@ class SEGSDetailer:
CATEGORY = "ImpactPack/Detailer"
DESCRIPTION = "This node enhances details by inpainting each region within the detected area bundle (SEGS) after enlarging them based on the guide size.\nThis node is applied specifically to SEGS rather than the entire image. To apply it to the entire image, use the 'SEGS Paste' node."
@staticmethod
def do_detail(image, segs, guide_size, guide_size_for, max_size, seed, steps, cfg, sampler_name, scheduler,
denoise, noise_mask, force_inpaint, basic_pipe, refiner_ratio=None, batch_size=1, cycle=1,
@@ -174,6 +177,8 @@ class SEGSPaste:
CATEGORY = "ImpactPack/Detailer"
DESCRIPTION = "This node provides a function to paste the enhanced SEGS, improved through the SEGS detailer, back onto the original image."
@staticmethod
def doit(image, segs, feather, alpha=255, ref_image_opt=None):
@@ -500,7 +505,7 @@ class SEGSOrderedFilter:
def INPUT_TYPES(s):
return {"required": {
"segs": ("SEGS", ),
"target": (["area(=w*h)", "width", "height", "x1", "y1", "x2", "y2", "confidence"],),
"target": (["area(=w*h)", "width", "height", "x1", "y1", "x2", "y2", "confidence", "none"],),
"order": ("BOOLEAN", {"default": True, "label_on": "descending", "label_off": "ascending"}),
"take_start": ("INT", {"default": 0, "min": 0, "max": sys.maxsize, "step": 1}),
"take_count": ("INT", {"default": 1, "min": 0, "max": sys.maxsize, "step": 1}),
@@ -513,51 +518,35 @@ class SEGSOrderedFilter:
CATEGORY = "ImpactPack/Util"
@staticmethod
def get_sort_key_fn(target: str) -> Union[Callable, None]:
if target == "none":
return None
def sort_key_fn(seg):
x1, y1, x2, y2 = seg.crop_region
if target == "confidence": return seg.confidence
if target == "area(=w*h)": return (x2 - x1) * (y2 - y1)
if target == "width": return x2 - x1
if target == "height": return y2 - y1
if target == "x1": return x1
if target == "y1": return y1
if target == "x2": return x2
if target == "y2": return y2
raise Exception(f"[Impact Pack] SEGSOrderedFilter - Unexpected target '{target}'")
return sort_key_fn
def doit(self, segs, target, order, take_start, take_count):
segs_with_order = []
sort_key_fn = SEGSOrderedFilter.get_sort_key_fn(target)
for seg in segs[1]:
x1 = seg.crop_region[0]
y1 = seg.crop_region[1]
x2 = seg.crop_region[2]
y2 = seg.crop_region[3]
sorted_list = list(segs[1]) # make a shallow copy, so it does not mutate the original list when sort
if sort_key_fn is not None:
sorted_list.sort(key=sort_key_fn, reverse=order)
if target == "area(=w*h)":
value = (y2 - y1) * (x2 - x1)
elif target == "width":
value = x2 - x1
elif target == "height":
value = y2 - y1
elif target == "x1":
value = x1
elif target == "x2":
value = x2
elif target == "y1":
value = y1
elif target == "y2":
value = y2
elif target == "confidence":
value = seg.confidence
else:
raise Exception(f"[Impact Pack] SEGSOrderedFilter - Unexpected target '{target}'")
segs_with_order.append((value, seg))
if order:
sorted_list = sorted(segs_with_order, key=lambda x: x[0], reverse=True)
else:
sorted_list = sorted(segs_with_order, key=lambda x: x[0], reverse=False)
result_list = []
remained_list = []
for i, item in enumerate(sorted_list):
if take_start <= i < take_start + take_count:
result_list.append(item[1])
else:
remained_list.append(item[1])
return (segs[0], result_list), (segs[0], remained_list),
take_stop = take_start + take_count
return (segs[0], sorted_list[take_start:take_stop]), \
(segs[0], sorted_list[:take_start] + sorted_list[take_stop:]),
class SEGSRangeFilter:
@@ -625,6 +614,111 @@ class SEGSRangeFilter:
return (segs[0], new_segs), (segs[0], remained_segs),
class SEGSIntersectionFilter:
@classmethod
def INPUT_TYPES(s):
return {"required": {
"segs1": ("SEGS", ),
"segs2": ("SEGS", ),
"ioa_threshold": ("FLOAT", {"default": 0.5, "min": 0.0, "max": 1.0, "step": 0.01}),
},
}
RETURN_TYPES = ("SEGS",)
RETURN_NAMES = ("filtered_SEGS",)
FUNCTION = "doit"
CATEGORY = "ImpactPack/Util"
def compute_ioa(self, mask1, mask2):
"""Compute Intersection over Area (IoA) between two boxes."""
inter_mask = utils.bitwise_and_masks(mask1, mask2)
inter_area = (inter_mask > 0).sum()
area1 = (mask1 > 0).sum()
return inter_area / area1 if area1 > 0 else 0
def doit(self, segs1, segs2, ioa_threshold):
"""Remove segments from segs1 if their IoA with any segment in segs2 exceeds the threshold."""
# Extract bounding boxes for all segments in segs1 and segs2
keep = []
# Iterate over all segments in segs1
for idx1, seg1 in enumerate(segs1[1]):
keep_segment = True # Assume the segment should be kept
mask1 = core.segs_to_combined_mask((segs1[0], [seg1]))
# Compare with every segment in segs2
for seg2 in segs2[1]:
mask2 = core.segs_to_combined_mask((segs2[0], [seg2]))
ioa = self.compute_ioa(mask1, mask2) # IoA between segment 1 and segment 2
if ioa > ioa_threshold: # If IoA exceeds the threshold, mark the segment for removal
keep_segment = False
break # If one overlap exceeds threshold, break early and mark for removal
# Keep the segment if it did not exceed the threshold with any other segment
if keep_segment:
keep.append(segs1[1][idx1])
return (segs1[0], keep), # Return the updated SEGS
class SEGSNMSFilter:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"segs": ("SEGS",),
"iou_threshold": ("FLOAT", {"default": 0.5, "min": 0.0, "max": 1.0, "step": 0.01}),
},
}
RETURN_TYPES = ("SEGS",)
RETURN_NAMES = ("filtered_SEGS",)
FUNCTION = "doit"
CATEGORY = "ImpactPack/Util"
def compute_iou(self, mask1, mask2):
"""Compute IoU between two bounding boxes (x1, y1, x2, y2)."""
inter_mask = utils.bitwise_and_masks(mask1, mask2)
union_mask = utils.add_masks(mask1, mask2)
inter_area = (inter_mask > 0).sum()
union_area = (union_mask > 0).sum()
return inter_area / union_area if union_area > 0 else 0
def doit(self, segs, iou_threshold):
"""Perform NMS to filter overlapping segments."""
confidences = np.ndarray.flatten(np.array([seg.confidence for seg in segs[1]]))
# Sort boxes by confidence (high to low)
sorted_indices = np.argsort(confidences)[::-1].tolist()
keep = []
while len(sorted_indices) > 0:
idx = sorted_indices[0]
mask1 = core.segs_to_combined_mask((segs[0], [segs[1][idx]]))
keep.append(idx)
sorted_indices = sorted_indices[1:]
# Filter indices only contain the indices where the bbox does not intersect
filtered_indices = []
for i in sorted_indices:
mask2 = core.segs_to_combined_mask((segs[0], [segs[1][i]]))
iou = self.compute_iou(mask1, mask2)
if iou < iou_threshold:
filtered_indices.append(i)
sorted_indices = np.array(filtered_indices)
filtered_segs = [segs[1][i] for i in keep]
return (segs[0], filtered_segs),
class SEGSToImageList:
@classmethod
def INPUT_TYPES(s):
@@ -1486,6 +1580,8 @@ class SEGSPicker:
CATEGORY = "ImpactPack/Util"
DESCRIPTION = "This node provides a function to select only the chosen SEGS from the input SEGS."
@staticmethod
def doit(picks, segs, fallback_image_opt=None, unique_id=None):
if fallback_image_opt is not None:
@@ -1542,6 +1638,8 @@ class DefaultImageForSEGS:
CATEGORY = "ImpactPack/Util"
DESCRIPTION = "If the SEGS have not passed through the detailer, they contain only detection area information without an image. This node sets a default image for the SEGS."
@staticmethod
def doit(segs, image, override):
results = []
+25
View File
@@ -446,6 +446,31 @@ class MakeMaskList:
return (masks, )
class NthItemOfAnyList:
@classmethod
def INPUT_TYPES(s):
return {"required": {
"any_list": (any_typ,),
"index": ("INT", {"default": 0, "min": 0, "max": sys.maxsize, "step": 1, "tooltip": "The index of the item you want to select from the list."}),
}
}
RETURN_TYPES = (any_typ,)
INPUT_IS_LIST = True
FUNCTION = "doit"
CATEGORY = "ImpactPack/Util"
DESCRIPTION = "Selects the Nth item from a list. If the index is out of range, it returns the last item in the list."
def doit(self, any_list, index):
i = index[0]
if i >= len(any_list):
return (any_list[-1],)
else:
return (any_list[i],)
class MakeImageList:
@classmethod
def INPUT_TYPES(s):
+53 -13
View File
@@ -178,31 +178,71 @@ def tensor2numpy(image):
def tensor_paste(image1, image2, left_top, mask):
"""Mask and image2 has to be the same size"""
"""
Pastes image2 onto image1 at position left_top using mask.
Supports both RGB and RGBA images.
"""
_tensor_check_image(image1)
_tensor_check_image(image2)
_tensor_check_mask(mask)
if image2.shape[1:3] != mask.shape[1:3]:
mask = resize_mask(mask.squeeze(dim=3), image2.shape[1:3]).unsqueeze(dim=3)
# raise ValueError(f"Inconsistent size: Image ({image2.shape[1:3]}) != Mask ({mask.shape[1:3]})")
x, y = left_top
_, h1, w1, _ = image1.shape
_, h2, w2, _ = image2.shape
# calculate image patch size
_, h1, w1, c1 = image1.shape
_, h2, w2, c2 = image2.shape
# Calculate image patch size
w = min(w1, x + w2) - x
h = min(h1, y + h2) - y
# If the patch is out of bound, nothing to do!
if w <= 0 or h <= 0:
return
mask = mask[:, :h, :w, :]
image1[:, y:y+h, x:x+w, :] = (
(1 - mask) * image1[:, y:y+h, x:x+w, :] +
mask * image2[:, :h, :w, :]
)
# Get the region to be modified
region1 = image1[:, y:y+h, x:x+w, :]
region2 = image2[:, :h, :w, :]
# Handle RGB and RGBA cases
if c1 == 3 and c2 == 3:
# Both RGB - simple case
image1[:, y:y+h, x:x+w, :] = (1 - mask) * region1 + mask * region2
elif c1 == 4 and c2 == 4:
# Both RGBA - need to handle alpha channel separately
# RGB channels
image1[:, y:y+h, x:x+w, :3] = (
(1 - mask) * region1[:, :, :, :3] +
mask * region2[:, :, :, :3]
)
# Alpha channel - use "over" composition
a1 = region1[:, :, :, 3:4]
a2 = region2[:, :, :, 3:4] * mask
new_alpha = a1 + a2 * (1 - a1)
image1[:, y:y+h, x:x+w, 3:4] = new_alpha
elif c1 == 4 and c2 == 3:
# Target is RGBA, source is RGB - assume source is fully opaque
image1[:, y:y+h, x:x+w, :3] = (
(1 - mask) * region1[:, :, :, :3] +
mask * region2
)
# Alpha channel - reduce alpha where mask is applied
image1[:, y:y+h, x:x+w, 3:4] = region1[:, :, :, 3:4] * (1 - mask) + mask
elif c1 == 3 and c2 == 4:
# Target is RGB, source is RGBA - apply source alpha to mask
effective_mask = mask * region2[:, :, :, 3:4]
image1[:, y:y+h, x:x+w, :] = (
(1 - effective_mask) * region1 +
effective_mask * region2[:, :, :, :3]
)
return
+76 -35
View File
@@ -8,6 +8,7 @@ import numpy as np
import threading
from impact import utils
from impact import config
import logging
wildcards_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "wildcards"))
@@ -44,7 +45,9 @@ def read_wildcard(k, v):
elif isinstance(v, str):
k = wildcard_normalize(k)
wildcard_dict[k] = [v]
elif isinstance(v, (int, float)):
k = wildcard_normalize(k)
wildcard_dict[k] = [str(v)]
def read_wildcard_dict(wildcard_path):
global wildcard_dict
@@ -63,7 +66,7 @@ def read_wildcard_dict(wildcard_path):
with open(file_path, 'r', encoding="UTF-8", errors="ignore") as f:
lines = f.read().splitlines()
wildcard_dict[key] = [x for x in lines if not x.strip().startswith('#')]
elif file.endswith('.yaml'):
elif file.endswith('.yaml') or file.endswith('.yml'):
file_path = os.path.join(root, file)
try:
@@ -135,6 +138,8 @@ def process(text, seed=None):
b = r.group(3)
if b is not None:
b = b.strip()
else:
b = "-1"
if r is not None:
if b is not None and is_numeric_string(a) and is_numeric_string(b):
@@ -145,26 +150,32 @@ def process(text, seed=None):
x = int(a)
select_range = (x, x)
# Expand wildcard path or return the string after $$
def expand_wildcard_or_return_string(options, pattern, wildcard_pattern):
matches = re.findall(wildcard_pattern, pattern)
if len(options) == 1 and matches:
# $$<single wildcard>
return get_wildcard_options(pattern)
else:
# $$opt1|opt2|...
options[0] = pattern
return options
if select_range is not None and len(multi_select_pattern) == 2:
# PATTERN: count$$
matches = re.findall(wildcard_pattern, multi_select_pattern[1])
if len(options) == 1 and matches:
# count$$<single wildcard>
options = get_wildcard_options(multi_select_pattern[1])
else:
# count$$opt1|opt2|...
options[0] = multi_select_pattern[1]
options = expand_wildcard_or_return_string(options, multi_select_pattern[1], wildcard_pattern )
elif select_range is not None and len(multi_select_pattern) == 3:
# PATTERN: count$$ sep $$
select_sep = multi_select_pattern[1]
options[0] = multi_select_pattern[2]
options = expand_wildcard_or_return_string(options, multi_select_pattern[2], wildcard_pattern )
adjusted_probabilities = []
total_prob = 0
for option in options:
parts = option.split('::', 1)
parts = option.split('::', 1) if isinstance(option, str) else f"{option}".split('::', 1)
if len(parts) == 2 and is_numeric_string(parts[0].strip()):
config_value = float(parts[0].strip())
else:
@@ -178,15 +189,30 @@ def process(text, seed=None):
if select_range is None:
select_count = 1
else:
select_count = random_gen.integers(low=select_range[0], high=select_range[1]+1, size=1)
def calculate_max(_options_length, _max_select_range):
return min(_max_select_range + 1, _options_length + 1) if _max_select_range > 0 else _options_length + 1
if select_count > len(options):
def calculate_select_count(_max_value, _min_select_range, random_gen):
if max(_max_value, _min_select_range) <= 0:
return 0
# fix: low >= high
elif _max_value == _min_select_range:
return _max_value
else:
# fix: low >= high
_low_value = min(_min_select_range, _max_value)
_high_value = max(_min_select_range, _max_value)
return random_gen.integers(low=_low_value, high=_high_value, size=1)
select_count = calculate_select_count(calculate_max(len(options), select_range[1]), select_range[0], random_gen)
if select_count > len(options) or total_prob <= 1:
random_gen.shuffle(options)
selected_items = options
else:
selected_items = random_gen.choice(options, p=normalized_probabilities, size=select_count, replace=False)
selected_items2 = [re.sub(r'^\s*[0-9.]+::', '', x, 1) for x in selected_items]
# x may be numpy.int32, convert to string
selected_items2 = [re.sub(r'^\s*[0-9.]+::', '', str(x), count=1) for x in selected_items]
replacement = select_sep.join(selected_items2)
if '::' in replacement:
pass
@@ -194,7 +220,7 @@ def process(text, seed=None):
replacements_found = True
return replacement
pattern = r'{([^{}]*?)}'
pattern = r'(?<!\\)\{((?:[^{}]|(?<=\\)[{}])*?)(?<!\\)\}'
replaced_string = re.sub(pattern, replace_option, string)
return replaced_string, replacements_found
@@ -253,7 +279,7 @@ def process(text, seed=None):
normalized_probabilities = [prob / total_prob for prob in adjusted_probabilities]
selected_item = random_gen.choice(options, p=normalized_probabilities, replace=False)
replacement = re.sub(r'^\s*[0-9.]+::', '', selected_item, 1)
replacement = re.sub(r'^\s*[0-9.]+::', '', selected_item, count=1)
replacements_found = True
string = string.replace(f"__{match}__", replacement, 1)
elif '*' in keyword:
@@ -333,6 +359,7 @@ def extract_lora_values(string):
lbw = None
lbw_a = None
lbw_b = None
loader = None
if len(item) > 0:
lora = item[0]
@@ -351,6 +378,8 @@ def extract_lora_values(string):
lbw_b = safe_float(lbw_item[2:].strip())
elif lbw_item.strip() != '':
lbw = lbw_item
elif sub_item.startswith("LOADER="):
loader = sub_item[7:]
if a is None:
a = 1.0
@@ -358,7 +387,7 @@ def extract_lora_values(string):
b = a
if lora is not None and lora not in added:
result.append((lora, a, b, lbw, lbw_a, lbw_b))
result.append((lora, a, b, lbw, lbw_a, lbw_b, loader))
added.add(lora)
return result
@@ -382,6 +411,8 @@ def resolve_lora_name(lora_name_cache, name):
if x.endswith(name):
return x
return None
def process_with_loras(wildcard_opt, model, clip, clip_encoder=None, seed=None, processed=None):
"""
@@ -402,7 +433,7 @@ def process_with_loras(wildcard_opt, model, clip, clip_encoder=None, seed=None,
loras = extract_lora_values(pass1)
pass2 = remove_lora_tags(pass1)
for lora_name, model_weight, clip_weight, lbw, lbw_a, lbw_b in loras:
for lora_name, model_weight, clip_weight, lbw, lbw_a, lbw_b, loader in loras:
lora_name_ext = lora_name.split('.')
if ('.'+lora_name_ext[-1]) not in folder_paths.supported_pt_extensions:
lora_name = lora_name+".safetensors"
@@ -416,26 +447,36 @@ def process_with_loras(wildcard_opt, model, clip, clip_encoder=None, seed=None,
path = None
if path is not None:
print(f"LOAD LORA: {lora_name}: {model_weight}, {clip_weight}, LBW={lbw}, A={lbw_a}, B={lbw_b}")
logging.info(f"LOAD LORA: {lora_name}: {model_weight}, {clip_weight}, LBW={lbw}, A={lbw_a}, B={lbw_b}, LOADER={loader}")
def default_lora():
return nodes.LoraLoader().load_lora(model, clip, lora_name, model_weight, clip_weight)
if lbw is not None:
if 'LoraLoaderBlockWeight //Inspire' not in nodes.NODE_CLASS_MAPPINGS:
utils.try_install_custom_node(
'https://github.com/ltdrdata/ComfyUI-Inspire-Pack',
"To use 'LBW=' syntax in wildcards, 'Inspire Pack' extension is required.")
print(f"'LBW(Lora Block Weight)' is given, but the 'Inspire Pack' is not installed. The LBW= attribute is being ignored.")
model, clip = default_lora()
if loader is not None:
if loader == 'nunchaku':
if 'NunchakuFluxLoraLoader' not in nodes.NODE_CLASS_MAPPINGS:
logging.warning(f"To use `LOADER=nunchaku`, 'ComfyUI-nunchaku' is required. The LOADER= attribute is being ignored.")
cls = nodes.NODE_CLASS_MAPPINGS['NunchakuFluxLoraLoader']
model = cls().load_lora(model, lora_name, model_weight)[0]
else:
cls = nodes.NODE_CLASS_MAPPINGS['LoraLoaderBlockWeight //Inspire']
model, clip, _ = cls().doit(model, clip, lora_name, model_weight, clip_weight, False, 0, lbw_a, lbw_b, "", lbw)
logging.warning(f"LORA LOADER NOT FOUND: '{loader}'")
else:
model, clip = default_lora()
def default_lora():
return nodes.LoraLoader().load_lora(model, clip, lora_name, model_weight, clip_weight)
if lbw is not None:
if 'LoraLoaderBlockWeight //Inspire' not in nodes.NODE_CLASS_MAPPINGS:
utils.try_install_custom_node(
'https://github.com/ltdrdata/ComfyUI-Inspire-Pack',
"To use 'LBW=' syntax in wildcards, 'Inspire Pack' extension is required.")
logging.warning(f"'LBW(Lora Block Weight)' is given, but the 'Inspire Pack' is not installed. The LBW= attribute is being ignored.")
model, clip = default_lora()
else:
cls = nodes.NODE_CLASS_MAPPINGS['LoraLoaderBlockWeight //Inspire']
model, clip, _ = cls().doit(model, clip, lora_name, model_weight, clip_weight, False, 0, lbw_a, lbw_b, "", lbw)
else:
model, clip = default_lora()
else:
print(f"LORA NOT FOUND: {orig_lora_name}")
logging.warning(f"LORA NOT FOUND: {orig_lora_name}")
pass3 = [x.strip() for x in pass2.split("BREAK")]
pass3 = [x for x in pass3 if x != '']
@@ -444,7 +485,7 @@ def process_with_loras(wildcard_opt, model, clip, clip_encoder=None, seed=None,
pass3 = ['']
pass3_str = [f'[{x}]' for x in pass3]
print(f"CLIP: {str.join(' + ', pass3_str)}")
logging.info(f"CLIP: {str.join(' + ', pass3_str)}")
result = None
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui-impact-pack"
description = "This node pack offers various detector nodes and detailer nodes that allow you to configure a workflow that automatically enhances facial details. And provide iterative upscaler."
version = "8.6"
version = "8.17.1"
license = { file = "LICENSE.txt" }
dependencies = ["segment-anything", "scikit-image", "piexif", "transformers", "opencv-python-headless", "GitPython", "scipy>=1.11.4"]
+1 -1
View File
@@ -4,6 +4,6 @@ piexif
transformers
opencv-python-headless
scipy>=1.11.4
numpy<2
numpy
dill
matplotlib
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long