Compare commits
35 Commits
3.32
...
tests/api-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da87651e53 | ||
|
|
416122d61d | ||
|
|
d3c625e791 | ||
|
|
ca2c41783c | ||
|
|
e2a6446585 | ||
|
|
839790b5ab | ||
|
|
58b9946936 | ||
|
|
a19ba22eaf | ||
|
|
117715aa22 | ||
|
|
891a5a85ee | ||
|
|
166debfabb | ||
|
|
7258a09fe5 | ||
|
|
058a436187 | ||
|
|
1950802c55 | ||
|
|
eb52a03372 | ||
|
|
f8aa428be3 | ||
|
|
ec0893f136 | ||
|
|
92b99ea963 | ||
|
|
02cd52bb65 | ||
|
|
af1ec2c87b | ||
|
|
41006c3a33 | ||
|
|
116a6d500d | ||
|
|
87d0ac807f | ||
|
|
fc943172eb | ||
|
|
9daa5a2fbd | ||
|
|
b7b2746a61 | ||
|
|
d66a4fbfc8 | ||
|
|
683a172ad8 | ||
|
|
6e12358f5a | ||
|
|
8bcf16dc90 | ||
|
|
65c0a2a1f5 | ||
|
|
115236eb9c | ||
|
|
08de942abe | ||
|
|
e9dff83290 | ||
|
|
3bc6c7584d |
10
cm-cli.py
10
cm-cli.py
@@ -45,7 +45,11 @@ comfyui_manager_path = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
cm_global.pip_blacklist = {'torch', 'torchaudio', 'torchsde', 'torchvision'}
|
||||
cm_global.pip_downgrade_blacklist = ['torch', 'torchaudio', 'torchsde', 'torchvision', 'transformers', 'safetensors', 'kornia']
|
||||
cm_global.pip_overrides = {'numpy': 'numpy<2'}
|
||||
|
||||
if sys.version_info < (3, 13):
|
||||
cm_global.pip_overrides = {'numpy': 'numpy<2'}
|
||||
else:
|
||||
cm_global.pip_overrides = {}
|
||||
|
||||
if os.path.exists(os.path.join(manager_util.comfyui_manager_path, "pip_overrides.json")):
|
||||
with open(os.path.join(manager_util.comfyui_manager_path, "pip_overrides.json"), 'r', encoding="UTF-8", errors="ignore") as json_file:
|
||||
@@ -147,7 +151,9 @@ class Ctx:
|
||||
if os.path.exists(core.manager_pip_overrides_path):
|
||||
with open(core.manager_pip_overrides_path, 'r', encoding="UTF-8", errors="ignore") as json_file:
|
||||
cm_global.pip_overrides = json.load(json_file)
|
||||
cm_global.pip_overrides = {'numpy': 'numpy<2'}
|
||||
|
||||
if sys.version_info < (3, 13):
|
||||
cm_global.pip_overrides = {'numpy': 'numpy<2'}
|
||||
|
||||
if os.path.exists(core.manager_pip_blacklist_path):
|
||||
with open(core.manager_pip_blacklist_path, 'r', encoding="UTF-8", errors="ignore") as f:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
7098
github-stats.json
7098
github-stats.json
File diff suppressed because it is too large
Load Diff
@@ -43,7 +43,7 @@ import manager_downloader
|
||||
from node_package import InstalledNodePackage
|
||||
|
||||
|
||||
version_code = [3, 32]
|
||||
version_code = [3, 32, 3]
|
||||
version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
|
||||
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import re
|
||||
import logging
|
||||
import platform
|
||||
import shlex
|
||||
import cm_global
|
||||
|
||||
|
||||
cache_lock = threading.Lock()
|
||||
@@ -256,7 +257,7 @@ def get_installed_packages(renew=False):
|
||||
pip_map[normalized_name] = y[1]
|
||||
except subprocess.CalledProcessError:
|
||||
logging.error("[ComfyUI-Manager] Failed to retrieve the information of installed pip packages.")
|
||||
return set()
|
||||
return {}
|
||||
|
||||
return pip_map
|
||||
|
||||
@@ -411,8 +412,9 @@ class PIPFixer:
|
||||
|
||||
if len(targets) > 0:
|
||||
for x in targets:
|
||||
cmd = make_pip_cmd(['install', f"{x}=={versions[0].version_string}", "numpy<2"])
|
||||
subprocess.check_output(cmd, universal_newlines=True)
|
||||
if sys.version_info < (3, 13):
|
||||
cmd = make_pip_cmd(['install', f"{x}=={versions[0].version_string}", "numpy<2"])
|
||||
subprocess.check_output(cmd, universal_newlines=True)
|
||||
|
||||
logging.info(f"[ComfyUI-Manager] 'opencv' dependencies were fixed: {targets}")
|
||||
except Exception as e:
|
||||
@@ -420,17 +422,21 @@ class PIPFixer:
|
||||
logging.error(e)
|
||||
|
||||
# fix numpy
|
||||
try:
|
||||
np = new_pip_versions.get('numpy')
|
||||
if np is not None:
|
||||
if StrictVersion(np) >= StrictVersion('2'):
|
||||
cmd = make_pip_cmd(['install', "numpy<2"])
|
||||
subprocess.check_output(cmd , universal_newlines=True)
|
||||
if sys.version_info >= (3, 13):
|
||||
logging.info("[ComfyUI-Manager] In Python 3.13 and above, PIP Fixer does not downgrade `numpy` below version 2.0. If you need to force a downgrade of `numpy`, please use `pip_auto_fix.list`.")
|
||||
else:
|
||||
try:
|
||||
np = new_pip_versions.get('numpy')
|
||||
if cm_global.pip_overrides.get('numpy') == 'numpy<2':
|
||||
if np is not None:
|
||||
if StrictVersion(np) >= StrictVersion('2'):
|
||||
cmd = make_pip_cmd(['install', "numpy<2"])
|
||||
subprocess.check_output(cmd , universal_newlines=True)
|
||||
|
||||
logging.info("[ComfyUI-Manager] 'numpy' dependency were fixed")
|
||||
except Exception as e:
|
||||
logging.error("[ComfyUI-Manager] Failed to restore numpy")
|
||||
logging.error(e)
|
||||
logging.info("[ComfyUI-Manager] 'numpy' dependency were fixed")
|
||||
except Exception as e:
|
||||
logging.error("[ComfyUI-Manager] Failed to restore numpy")
|
||||
logging.error(e)
|
||||
|
||||
# fix missing frontend
|
||||
try:
|
||||
|
||||
@@ -4969,9 +4969,9 @@
|
||||
|
||||
{
|
||||
"name": "LTX-Video Spatial Upscaler v0.9.7",
|
||||
"type": "checkpoint",
|
||||
"base": "LTX-Video",
|
||||
"save_path": "checkpoints/LTXV",
|
||||
"type": "upscale",
|
||||
"base": "upscale",
|
||||
"save_path": "default",
|
||||
"description": "Spatial upscaler model for LTX-Video. This model enhances the spatial resolution of generated videos.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-Video",
|
||||
"filename": "ltxv-spatial-upscaler-0.9.7.safetensors",
|
||||
@@ -4980,9 +4980,9 @@
|
||||
},
|
||||
{
|
||||
"name": "LTX-Video Temporal Upscaler v0.9.7",
|
||||
"type": "checkpoint",
|
||||
"base": "LTX-Video",
|
||||
"save_path": "checkpoints/LTXV",
|
||||
"type": "upscale",
|
||||
"base": "upscale",
|
||||
"save_path": "default",
|
||||
"description": "Temporal upscaler model for LTX-Video. This model enhances the temporal resolution and smoothness of generated videos.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-Video",
|
||||
"filename": "ltxv-temporal-upscaler-0.9.7.safetensors",
|
||||
@@ -5010,6 +5010,50 @@
|
||||
"filename": "ltxv-13b-0.9.7-dev-fp8.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-Video/resolve/main/ltxv-13b-0.9.7-dev-fp8.safetensors",
|
||||
"size": "15.7GB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-Video 13B Distilled v0.9.7",
|
||||
"type": "checkpoint",
|
||||
"base": "LTX-Video",
|
||||
"save_path": "checkpoints/LTXV",
|
||||
"description": "Distilled version of the LTX-Video 13B model, providing improved efficiency while maintaining high-resolution quality.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-Video",
|
||||
"filename": "ltxv-13b-0.9.7-distilled.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-Video/resolve/main/ltxv-13b-0.9.7-distilled.safetensors",
|
||||
"size": "28.6GB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-Video 13B Distilled FP8 v0.9.7",
|
||||
"type": "checkpoint",
|
||||
"base": "LTX-Video",
|
||||
"save_path": "checkpoints/LTXV",
|
||||
"description": "Quantized distilled version of the LTX-Video 13B model, optimized for even lower VRAM usage while maintaining quality.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-Video",
|
||||
"filename": "ltxv-13b-0.9.7-distilled-fp8.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-Video/resolve/main/ltxv-13b-0.9.7-distilled-fp8.safetensors",
|
||||
"size": "15.7GB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-Video 13B Distilled LoRA v0.9.7",
|
||||
"type": "lora",
|
||||
"base": "LTX-Video",
|
||||
"save_path": "loras",
|
||||
"description": "A LoRA adapter that transforms the standard LTX-Video 13B model into a distilled version when loaded.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-Video",
|
||||
"filename": "ltxv-13b-0.9.7-distilled-lora128.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-Video/resolve/main/ltxv-13b-0.9.7-distilled-lora128.safetensors",
|
||||
"size": "1.33GB"
|
||||
},
|
||||
{
|
||||
"name": "Latent Bridge Matching for Image Relighting",
|
||||
"type": "diffusion_model",
|
||||
"base": "LBM",
|
||||
"save_path": "diffusion_models/LBM",
|
||||
"description": "Latent Bridge Matching (LBM) Relighting model",
|
||||
"reference": "https://huggingface.co/jasperai/LBM_relighting",
|
||||
"filename": "LBM_relighting.safetensors",
|
||||
"url": "https://huggingface.co/jasperai/LBM_relighting/resolve/main/model.safetensors",
|
||||
"size": "5.02GB"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -12,6 +12,297 @@
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
"author": "zhengxyz123",
|
||||
"title": "zhengxyz123/ComfyUI-CLIPSeg [NAME CONFLICT]",
|
||||
"reference": "https://github.com/zhengxyz123/ComfyUI-CLIPSeg",
|
||||
"files": [
|
||||
"https://github.com/zhengxyz123/ComfyUI-CLIPSeg"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Using CLIPSeg model to generate masks for image inpainting tasks based on text or image prompts."
|
||||
},
|
||||
{
|
||||
"author": "Alazuaka",
|
||||
"title": "ComfyUI Image Analysis Toolkit [WIP]",
|
||||
"reference": "https://github.com/ThatGlennD/ComfyUI-Image-Analysis-Tools",
|
||||
"files": [
|
||||
"https://github.com/ThatGlennD/ComfyUI-Image-Analysis-Tools"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "A suite of custom ComfyUI nodes built to evaluate and diagnose the technical qualities of images—especially those generated by AI models. Rather than creating visuals, these tools measure them, offering precise insights into sharpness, noise, exposure, color balance, and more.\nNOTE: The files in the repo are not organized."
|
||||
},
|
||||
{
|
||||
"author": "trampolin",
|
||||
"title": "comfy-ui-scryfall",
|
||||
"reference": "https://github.com/trampolin/comfy-ui-scryfall",
|
||||
"files": [
|
||||
"https://github.com/trampolin/comfy-ui-scryfall"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Some ComfyUI nodes to fetch cards from scryfall"
|
||||
},
|
||||
{
|
||||
"author": "pomePLaszlo-collablyu",
|
||||
"title": "comfyui_ejam",
|
||||
"reference": "https://github.com/PLaszlo-collab/comfyui_ejam",
|
||||
"files": [
|
||||
"https://github.com/PLaszlo-collab/comfyui_ejam"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Ejam nodes for comfyui"
|
||||
},
|
||||
{
|
||||
"author": "pomelyu",
|
||||
"title": "cy-prompt-tools",
|
||||
"reference": "https://github.com/pomelyu/cy-prompt-tools",
|
||||
"files": [
|
||||
"https://github.com/pomelyu/cy-prompt-tools"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "prompt tools for comfyui"
|
||||
},
|
||||
{
|
||||
"author": "vivi-gomez",
|
||||
"title": "ComfyUI-fixnodetranslate",
|
||||
"reference": "https://github.com/vivi-gomez/ComfyUI-fixnodetranslate",
|
||||
"files": [
|
||||
"https://github.com/vivi-gomez/ComfyUI-fixnodetranslate"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Addon for ComfyUI that adds 'Fix node (recreate + keep inputs)' context menu option"
|
||||
},
|
||||
{
|
||||
"author": "Alazuaka",
|
||||
"title": "ES_nodes for ComfyUI by Alazuka [WIP]",
|
||||
"reference": "https://github.com/Alazuaka/comfyui-lora-stack-node",
|
||||
"files": [
|
||||
"https://github.com/Alazuaka/comfyui-lora-stack-node"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Node for LoRA stack management in ComfyUI\nNOTE: The files in the repo are not organized."
|
||||
},
|
||||
{
|
||||
"author": "Good-Dream-Studio",
|
||||
"title": "ComfyUI-Connect [WIP]",
|
||||
"reference": "https://github.com/Good-Dream-Studio/ComfyUI-Connect",
|
||||
"files": [
|
||||
"https://github.com/Good-Dream-Studio/ComfyUI-Connect"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Transform your ComfyUI into a powerful API, exposing all your saved workflows as ready-to-use HTTP endpoints."
|
||||
},
|
||||
{
|
||||
"author": "fuzr0dah",
|
||||
"title": "comfyui-sceneassembly",
|
||||
"reference": "https://github.com/fuzr0dah/comfyui-sceneassembly",
|
||||
"files": [
|
||||
"https://github.com/fuzr0dah/comfyui-sceneassembly"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "A bunch of nodes I created that I also find useful."
|
||||
},
|
||||
{
|
||||
"author": "PabloGrant",
|
||||
"title": "comfyui-giraffe-test-panel",
|
||||
"reference": "https://github.com/PabloGrant/comfyui-giraffe-test-panel",
|
||||
"files": [
|
||||
"https://github.com/PabloGrant/comfyui-giraffe-test-panel"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "General-purpose test node. [w/Use at your own risk. No warranties. No guaranteed support or future updates. Feel free to fork, but remember to share in case anyone else can benefit.]"
|
||||
},
|
||||
{
|
||||
"author": "lrzjason",
|
||||
"title": "Comfyui-Condition-Utils [WIP]",
|
||||
"reference": "https://github.com/lrzjason/Comfyui-Condition-Utils",
|
||||
"files": [
|
||||
"https://github.com/lrzjason/Comfyui-Condition-Utils"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "A collection of utility nodes for handling condition tensors in ComfyUI."
|
||||
},
|
||||
{
|
||||
"author": "gordon123",
|
||||
"title": "ComfyUI_DreamBoard [WIP]",
|
||||
"reference": "https://github.com/gordon123/ComfyUI_DreamBoard",
|
||||
"files": [
|
||||
"https://github.com/gordon123/ComfyUI_DreamBoard"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "for making storyboard UNDERCONSTRUCTION!"
|
||||
},
|
||||
{
|
||||
"author": "erosDiffusion",
|
||||
"title": "Select key from JSON (Alpha) [UNSAFE]",
|
||||
"reference": "https://github.com/erosDiffusion/ComfyUI-enricos-json-file-load-and-value-selector",
|
||||
"files": [
|
||||
"https://github.com/erosDiffusion/ComfyUI-enricos-json-file-load-and-value-selector"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "this node lists json files in the ComfyUI input folder[w/If this node pack is installed and the server is running with remote access enabled, it can read the contents of JSON files located in arbitrary paths.]"
|
||||
},
|
||||
{
|
||||
"author": "silveroxides",
|
||||
"title": "ComfyUI_EmbeddingToolkit",
|
||||
"reference": "https://github.com/silveroxides/ComfyUI_EmbeddingToolkit",
|
||||
"files": [
|
||||
"https://github.com/silveroxides/ComfyUI_EmbeddingToolkit"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES: Save Token Embeddings, Save Weighted Embeddings, Save A1111-style Weighted Embeddings"
|
||||
},
|
||||
{
|
||||
"author": "yichengup",
|
||||
"title": "ComfyUI-YCNodes_Advance",
|
||||
"reference": "https://github.com/yichengup/ComfyUI-YCNodes_Advance",
|
||||
"files": [
|
||||
"https://github.com/yichengup/ComfyUI-YCNodes_Advance"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES: Color Match (YC)"
|
||||
},
|
||||
{
|
||||
"author": "rakki194",
|
||||
"title": "ComfyUI_WolfSigmas [UNSAFE]",
|
||||
"reference": "https://github.com/rakki194/ComfyUI_WolfSigmas",
|
||||
"files": [
|
||||
"https://github.com/rakki194/ComfyUI_WolfSigmas"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "This custom node pack for ComfyUI provides a suite of tools for generating and manipulating sigma schedules for diffusion models. These nodes are particularly useful for fine-tuning the sampling process, experimenting with different step counts, and adapting schedules for specific models.[w/Security Warning: Remote Code Execution]"
|
||||
},
|
||||
{
|
||||
"author": "xl0",
|
||||
"title": "q_tools",
|
||||
"reference": "https://github.com/xl0/q_tools",
|
||||
"files": [
|
||||
"https://github.com/xl0/q_tools"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES: QLoadLatent, QLinearScheduler, QPreviewLatent, QGaussianLatent, QUniformLatent, QKSampler"
|
||||
},
|
||||
{
|
||||
"author": "wTechArtist",
|
||||
"title": "ComfyUI_WWL_Florence2SAM2",
|
||||
"reference": "https://github.com/wTechArtist/ComfyUI_WWL_Florence2SAM2",
|
||||
"files": [
|
||||
"https://github.com/wTechArtist/ComfyUI_WWL_Florence2SAM2"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES: WWL_Florence2SAM2"
|
||||
},
|
||||
{
|
||||
"author": "virallover",
|
||||
"title": "comfyui-virallover",
|
||||
"reference": "https://github.com/maizerrr/comfyui-code-nodes",
|
||||
"files": [
|
||||
"https://github.com/maizerrr/comfyui-code-nodes"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES: BBox Drawer, BBox Parser, Dummy Passthrough Node, Batch Images (up to 5), Mask Editor, OpenAI GPT-Image-1 Node, GhatGPT Node"
|
||||
},
|
||||
{
|
||||
"author": "virallover",
|
||||
"title": "comfyui-virallover",
|
||||
"reference": "https://github.com/virallover/comfyui-virallover",
|
||||
"files": [
|
||||
"https://github.com/virallover/comfyui-virallover"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES: Download and Load Lora Model Only"
|
||||
},
|
||||
{
|
||||
"author": "nobandegani",
|
||||
"title": "Ino Custom Nodes",
|
||||
"reference": "https://github.com/nobandegani/comfyui_ino_nodes",
|
||||
"files": [
|
||||
"https://github.com/nobandegani/comfyui_ino_nodes"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES: BeDrive Save Image, BeDrive Save File, BeDrive Get Parent ID, Ino Parse File Path, Ino Not Boolean, Ino Count Files"
|
||||
},
|
||||
{
|
||||
"author": "jax-explorer",
|
||||
"title": "ComfyUI-DreamO",
|
||||
"reference": "https://github.com/jax-explorer/ComfyUI-DreamO",
|
||||
"files": [
|
||||
"https://github.com/jax-explorer/ComfyUI-DreamO"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "[a/https://github.com/bytedance/DreamO](https://github.com/bytedance/DreamO]) ComfyUI Warpper"
|
||||
},
|
||||
{
|
||||
"author": "MakkiShizu",
|
||||
"title": "ComfyUI-MakkiTools",
|
||||
"reference": "https://github.com/MakkiShizu/ComfyUI-MakkiTools",
|
||||
"files": [
|
||||
"https://github.com/MakkiShizu/ComfyUI-MakkiTools"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES: GetImageNthCount, ImageChannelSeparate, ImageCountConcatenate, MergeImageChannels, ImageWidthStitch, ImageHeigthStitch"
|
||||
},
|
||||
{
|
||||
"author": "SKBv0",
|
||||
"title": "Retro Engine Node for ComfyUI",
|
||||
"reference": "https://github.com/SKBv0/ComfyUI-RetroEngine",
|
||||
"files": [
|
||||
"https://github.com/SKBv0/ComfyUI-RetroEngine"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "This custom node integrates [a/EmulatorJS](https://github.com/EmulatorJS/EmulatorJS) into ComfyUI, allowing you to run retro games and capture their screens for your image generation workflows."
|
||||
},
|
||||
{
|
||||
"author": "brace-great",
|
||||
"title": "comfyui-eim",
|
||||
"reference": "https://github.com/brace-great/comfyui-eim",
|
||||
"files": [
|
||||
"https://github.com/brace-great/comfyui-eim"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES: EncryptImage"
|
||||
},
|
||||
{
|
||||
"author": "p1atdev",
|
||||
"title": "comfyui-aesthetic-predictor",
|
||||
"reference": "https://github.com/p1atdev/comfyui-aesthetic-predictor",
|
||||
"files": [
|
||||
"https://github.com/p1atdev/comfyui-aesthetic-predictor"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES: Load Aesthetic Predictor, Predict Aesthetic Score"
|
||||
},
|
||||
{
|
||||
"author": "barakapa",
|
||||
"title": "barakapa-nodes",
|
||||
"reference": "https://github.com/barakapa/barakapa-nodes",
|
||||
"files": [
|
||||
"https://github.com/barakapa/barakapa-nodes"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Compare and save unique workflows, count tokens in prompt, and other utility."
|
||||
},
|
||||
{
|
||||
"author": "Maxed-Out-99",
|
||||
"title": "ComfyUI-MaxedOut",
|
||||
"reference": "https://github.com/Maxed-Out-99/ComfyUI-MaxedOut",
|
||||
"files": [
|
||||
"https://github.com/Maxed-Out-99/ComfyUI-MaxedOut"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Custom ComfyUI nodes used in Maxed Out workflows (SDXL, Flux, etc.)"
|
||||
},
|
||||
{
|
||||
"author": "VictorLopes643",
|
||||
"title": "ComfyUI-Video-Dataset-Tools [WIP]",
|
||||
"reference": "https://github.com/VictorLopes643/ComfyUI-Video-Dataset-Tools",
|
||||
"files": [
|
||||
"https://github.com/VictorLopes643/ComfyUI-Video-Dataset-Tools"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES: Video Frame Extractor, Image Frame Saver\nNOTE: The files in the repo are not organized."
|
||||
},
|
||||
{
|
||||
"author": "George0726",
|
||||
"title": "ComfyUI-video-accessory [WIP]",
|
||||
@@ -252,16 +543,6 @@
|
||||
"install_type": "git-clone",
|
||||
"description": "Custom nodes for managing, saving and loading of Redux/Style based embeddings."
|
||||
},
|
||||
{
|
||||
"author": "Jpzz",
|
||||
"title": "ComfyUI-VirtualInteraction [UNSAFE]",
|
||||
"reference": "https://github.com/Jpzz/ComfyUI-VirtualInteraction",
|
||||
"files": [
|
||||
"https://github.com/Jpzz/ComfyUI-VirtualInteraction"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES: virtual interaction custom node when using generative movie\n[w/This nodepack contains a node which is reading arbitrary excel file.]"
|
||||
},
|
||||
{
|
||||
"author": "StaffsGull",
|
||||
"title": "comfyui_scene_builder [WIP]",
|
||||
@@ -692,16 +973,6 @@
|
||||
"install_type": "git-clone",
|
||||
"description": "VideoDepthAnything nodes for ComfyUI"
|
||||
},
|
||||
{
|
||||
"author": "MITCAP",
|
||||
"title": "ComfyUI OpenAI DALL-E 3 Node [WIP]",
|
||||
"reference": "https://github.com/MITCAP/OpenAI-ComfyUI",
|
||||
"files": [
|
||||
"https://github.com/MITCAP/OpenAI-ComfyUI"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "This project provides custom nodes for ComfyUI that integrate with OpenAI's DALL-E 3 and GPT-4o models. The nodes allow users to generate images and describe images using OpenAI's API.\nNOTE: The files in the repo are not organized."
|
||||
},
|
||||
{
|
||||
"author": "benmizrahi",
|
||||
"title": "ComfyGCS [WIP]",
|
||||
@@ -1351,7 +1622,7 @@
|
||||
"https://github.com/BuffMcBigHuge/ComfyUI-Buff-Nodes"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Assorted Nodes by BuffMcBigHuge"
|
||||
"description": "Several quality-of-life batch operation and string manipulation nodes."
|
||||
},
|
||||
{
|
||||
"author": "ritikvirus",
|
||||
@@ -1834,16 +2105,6 @@
|
||||
"install_type": "git-clone",
|
||||
"description": "A collection of custom nodes for ComfyUI, focusing on image handling and LoRA training."
|
||||
},
|
||||
{
|
||||
"author": "thedivergentai",
|
||||
"title": "Divergent Nodes [WIP]",
|
||||
"reference": "https://github.com/thedivergentai/divergent_nodes",
|
||||
"files": [
|
||||
"https://github.com/thedivergentai/divergent_nodes"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "A ComfyUI custom node for counting CLIP tokens in text input."
|
||||
},
|
||||
{
|
||||
"author": "gold24park",
|
||||
"title": "loki-comfyui-node",
|
||||
@@ -3543,16 +3804,6 @@
|
||||
"install_type": "copy",
|
||||
"description": "This platform extension provides ZhipuAI nodes, enabling you to configure a workflow for online video generation."
|
||||
},
|
||||
{
|
||||
"author": "mfg637",
|
||||
"title": "ComfyUI-ScheduledGuider-Ext",
|
||||
"reference": "https://github.com/mfg637/ComfyUI-ScheduledGuider-Ext",
|
||||
"files": [
|
||||
"https://github.com/mfg637/ComfyUI-ScheduledGuider-Ext"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES:SheduledCFGGuider, CosineScheduler, InvertSigmas, ConcatSigmas."
|
||||
},
|
||||
{
|
||||
"author": "netanelben",
|
||||
"title": "comfyui-photobooth-customnode",
|
||||
|
||||
@@ -148,11 +148,23 @@
|
||||
],
|
||||
"https://github.com/1hew/ComfyUI-1hewNodes": [
|
||||
[
|
||||
"BlendModesAlpha",
|
||||
"CoordinateExtractor",
|
||||
"ImageConcatenate",
|
||||
"ImageAddLabel",
|
||||
"ImageBBoxCrop",
|
||||
"ImageBlendModesByCSS",
|
||||
"ImageCropSquare",
|
||||
"ImageCropWithBBox",
|
||||
"ImagePaste",
|
||||
"ImageCroppedPaste",
|
||||
"ImageDetailHLFreqSeparation",
|
||||
"ImageEditStitch",
|
||||
"ImagePlot",
|
||||
"ImageResizeUniversal",
|
||||
"LumaMatte",
|
||||
"MaskBBoxCrop",
|
||||
"MaskBatchMathOps",
|
||||
"MaskMathOps",
|
||||
"SliderValueRangeMapping",
|
||||
"Solid"
|
||||
],
|
||||
{
|
||||
@@ -590,6 +602,7 @@
|
||||
"TUZZI-DataloungeScraper",
|
||||
"TUZZI-DirectoryImagePromptReader",
|
||||
"TUZZI-GeminiFlash25",
|
||||
"TUZZI-GroqNode",
|
||||
"TUZZI-ImageAudioToVideo",
|
||||
"TUZZI-ImageExtractorSaver",
|
||||
"TUZZI-LineCounter",
|
||||
@@ -840,7 +853,10 @@
|
||||
[
|
||||
"ConsoleOutput",
|
||||
"FilePathSelectorFromDirectory",
|
||||
"StringProcessor"
|
||||
"MostRecentFileSelector",
|
||||
"RaftOpticalFlowNode",
|
||||
"StringProcessor",
|
||||
"TwoImageConcatenator"
|
||||
],
|
||||
{
|
||||
"title_aux": "ComfyUI-Buff-Nodes [WIP]"
|
||||
@@ -949,6 +965,7 @@
|
||||
"DevToolsNodeWithSeedInput",
|
||||
"DevToolsNodeWithStringInput",
|
||||
"DevToolsNodeWithUnionInput",
|
||||
"DevToolsNodeWithV2ComboInput",
|
||||
"DevToolsNodeWithValidation",
|
||||
"DevToolsObjectPatchNode",
|
||||
"DevToolsRemoteWidgetNode",
|
||||
@@ -1044,13 +1061,22 @@
|
||||
],
|
||||
"https://github.com/DonutsDelivery/ComfyUI-DonutDetailer": [
|
||||
[
|
||||
"ApplyLBW //Inspire",
|
||||
"Donut Detailer",
|
||||
"Donut Detailer 2",
|
||||
"Donut Detailer 4",
|
||||
"Donut Detailer LoRA 5",
|
||||
"Donut Detailer XL Blocks",
|
||||
"DonutApplyLoRAStack",
|
||||
"DonutClipEncode",
|
||||
"DonutWidenMerge"
|
||||
"DonutLoRAStack",
|
||||
"DonutWidenMerge",
|
||||
"LoadLBW //Inspire",
|
||||
"LoraBlockInfo //Inspire",
|
||||
"LoraLoaderBlockWeight //Inspire",
|
||||
"MakeLBW //Inspire",
|
||||
"SaveLBW //Inspire",
|
||||
"XY Input: Lora Block Weight //Inspire"
|
||||
],
|
||||
{
|
||||
"title_aux": "ComfyUI-DonutDetailer"
|
||||
@@ -1295,6 +1321,21 @@
|
||||
"title_aux": "ComfyUI-Notifier"
|
||||
}
|
||||
],
|
||||
"https://github.com/George0726/ComfyUI-video-accessory": [
|
||||
[
|
||||
"VideoAcc_CameraTrajectoryAdvance",
|
||||
"VideoAcc_CameraTrajectoryRecam",
|
||||
"VideoAcc_ImageResizeAdvanced",
|
||||
"VideoAcc_ImageUpscaleVideo",
|
||||
"VideoAcc_LoadImage",
|
||||
"VideoAcc_LoadVideo",
|
||||
"VideoAcc_SaveMP4",
|
||||
"VideoAcc_imageSize"
|
||||
],
|
||||
{
|
||||
"title_aux": "ComfyUI-video-accessory [WIP]"
|
||||
}
|
||||
],
|
||||
"https://github.com/Grant-CP/ComfyUI-LivePortraitKJ-MPS": [
|
||||
[
|
||||
"DownloadAndLoadLivePortraitModels",
|
||||
@@ -1424,17 +1465,6 @@
|
||||
"title_aux": "comfy-consistency-vae"
|
||||
}
|
||||
],
|
||||
"https://github.com/Jpzz/ComfyUI-VirtualInteraction": [
|
||||
[
|
||||
"JoinPromptNode",
|
||||
"JsonParserNode",
|
||||
"ShowTextNode",
|
||||
"UnzipPromptNode"
|
||||
],
|
||||
{
|
||||
"title_aux": "ComfyUI-VirtualInteraction [UNSAFE]"
|
||||
}
|
||||
],
|
||||
"https://github.com/Junst/ComfyUI-PNG2SVG2PNG": [
|
||||
[
|
||||
"PNG2SVG2PNG"
|
||||
@@ -1748,13 +1778,17 @@
|
||||
"title_aux": "comfy-tif-support"
|
||||
}
|
||||
],
|
||||
"https://github.com/MITCAP/OpenAI-ComfyUI": [
|
||||
"https://github.com/MakkiShizu/ComfyUI-MakkiTools": [
|
||||
[
|
||||
"OpenAIDalle3Node",
|
||||
"OpenAIImageDescriptionNode"
|
||||
"GetImageNthCount",
|
||||
"ImageChannelSeparate",
|
||||
"ImageCountConcatenate",
|
||||
"ImageHeigthStitch",
|
||||
"ImageWidthStitch",
|
||||
"MergeImageChannels"
|
||||
],
|
||||
{
|
||||
"title_aux": "ComfyUI OpenAI DALL-E 3 Node [WIP]"
|
||||
"title_aux": "ComfyUI-MakkiTools"
|
||||
}
|
||||
],
|
||||
"https://github.com/ManuShamil/ComfyUI_BodyEstimation_Nodes": [
|
||||
@@ -1775,6 +1809,18 @@
|
||||
"title_aux": "ComfyUI-MoviePy"
|
||||
}
|
||||
],
|
||||
"https://github.com/Maxed-Out-99/ComfyUI-MaxedOut": [
|
||||
[
|
||||
"Flux Empty Latent Image",
|
||||
"Image Scale To Total Pixels (SDXL Safe)",
|
||||
"SDXL Resolutions",
|
||||
"Sd 1.5 Empty Latent Image",
|
||||
"Sdxl Empty Latent Image"
|
||||
],
|
||||
{
|
||||
"title_aux": "ComfyUI-MaxedOut"
|
||||
}
|
||||
],
|
||||
"https://github.com/Maxim-Dey/ComfyUI-MaksiTools": [
|
||||
[
|
||||
"\ud83d\udd22 Return Boolean",
|
||||
@@ -2100,6 +2146,14 @@
|
||||
"title_aux": "ComfyUI-Folder-Images-Preview [UNSAFE]"
|
||||
}
|
||||
],
|
||||
"https://github.com/SKBv0/ComfyUI-RetroEngine": [
|
||||
[
|
||||
"RetroEngineNode"
|
||||
],
|
||||
{
|
||||
"title_aux": "Retro Engine Node for ComfyUI"
|
||||
}
|
||||
],
|
||||
"https://github.com/SS-snap/ComfyUI-Snap_Processing": [
|
||||
[
|
||||
"AreaCalculator",
|
||||
@@ -2165,6 +2219,7 @@
|
||||
"https://github.com/SanDiegoDude/ComfyUI-HiDream-Sampler": [
|
||||
[
|
||||
"HiDreamImg2Img",
|
||||
"HiDreamResolutionSelect",
|
||||
"HiDreamSampler",
|
||||
"HiDreamSamplerAdvanced"
|
||||
],
|
||||
@@ -2465,6 +2520,34 @@
|
||||
"title_aux": "TWanVideoSigmaSampler: EXPERIMENTAL [WIP]"
|
||||
}
|
||||
],
|
||||
"https://github.com/TheJorseman/IntrinsicCompositingClean-ComfyUI": [
|
||||
[
|
||||
"AlbedoHarmonizer",
|
||||
"AlbedoModelLoader",
|
||||
"CompleteRelighting",
|
||||
"CompositeNormalsCalculator",
|
||||
"DepthEstimator",
|
||||
"DepthModelLoader",
|
||||
"ExtractSmallBgShd",
|
||||
"HarmonizedImageCreator",
|
||||
"ImageResizer",
|
||||
"ImageResizerNP",
|
||||
"ImageResizerNPMASK",
|
||||
"IntrinsicDecomposer",
|
||||
"IntrinsicModelLoader",
|
||||
"LightCoeffExtractor",
|
||||
"LoadImagePIL",
|
||||
"MaskApplier",
|
||||
"MaskGenerator",
|
||||
"NormalsExtractor",
|
||||
"NormalsModelLoader",
|
||||
"ReshadingModelLoader",
|
||||
"ReshadingProcessor"
|
||||
],
|
||||
{
|
||||
"title_aux": "IntrinsicCompositingClean-ComfyUI"
|
||||
}
|
||||
],
|
||||
"https://github.com/ThisModernDay/ComfyUI-InstructorOllama": [
|
||||
[
|
||||
"OllamaInstructorNode"
|
||||
@@ -2505,6 +2588,15 @@
|
||||
"title_aux": "comfy-latent-nodes [UNSAFE]"
|
||||
}
|
||||
],
|
||||
"https://github.com/VictorLopes643/ComfyUI-Video-Dataset-Tools": [
|
||||
[
|
||||
"VideoFrameExtractor",
|
||||
"VideoFrameSaver"
|
||||
],
|
||||
{
|
||||
"title_aux": "ComfyUI-Video-Dataset-Tools [WIP]"
|
||||
}
|
||||
],
|
||||
"https://github.com/Video3DGenResearch/comfyui-batch-input-node": [
|
||||
[
|
||||
"BatchImageAndPrompt",
|
||||
@@ -2666,6 +2758,7 @@
|
||||
"BlenderTonemap",
|
||||
"BlenderTransform",
|
||||
"BlenderTranslate",
|
||||
"BlenderUV",
|
||||
"BlenderValue",
|
||||
"BlenderVectorMath",
|
||||
"BlenderWavelength",
|
||||
@@ -2972,6 +3065,14 @@
|
||||
"title_aux": "ComfyUI_BeySoft"
|
||||
}
|
||||
],
|
||||
"https://github.com/bheins/ComfyUI-glb-to-stl": [
|
||||
[
|
||||
"GLBToSTLNode"
|
||||
],
|
||||
{
|
||||
"title_aux": "ComfyUI-glb-to-stl [WIP]"
|
||||
}
|
||||
],
|
||||
"https://github.com/birnam/ComfyUI-GenData-Pack": [
|
||||
[
|
||||
"Checkpoint From String \ud83d\udc69\u200d\ud83d\udcbb",
|
||||
@@ -3146,6 +3247,14 @@
|
||||
"title_aux": "Bmad Nodes [UNSAFE]"
|
||||
}
|
||||
],
|
||||
"https://github.com/brace-great/comfyui-eim": [
|
||||
[
|
||||
"EncryptImage"
|
||||
],
|
||||
{
|
||||
"title_aux": "comfyui-eim"
|
||||
}
|
||||
],
|
||||
"https://github.com/bruce007lee/comfyui-cleaner": [
|
||||
[
|
||||
"cleaner"
|
||||
@@ -3338,6 +3447,7 @@
|
||||
],
|
||||
"https://github.com/comfyanonymous/ComfyUI": [
|
||||
[
|
||||
"APG",
|
||||
"AddNoise",
|
||||
"AlignYourStepsScheduler",
|
||||
"BasicGuider",
|
||||
@@ -3365,6 +3475,7 @@
|
||||
"CLIPVisionEncode",
|
||||
"CLIPVisionLoader",
|
||||
"Canny",
|
||||
"CaseConverter",
|
||||
"CheckpointLoader",
|
||||
"CheckpointLoaderSimple",
|
||||
"CheckpointSave",
|
||||
@@ -3431,6 +3542,7 @@
|
||||
"IdeogramV1",
|
||||
"IdeogramV2",
|
||||
"IdeogramV3",
|
||||
"ImageAddNoise",
|
||||
"ImageBatch",
|
||||
"ImageBlend",
|
||||
"ImageBlur",
|
||||
@@ -3602,6 +3714,8 @@
|
||||
"RecraftTextToImageNode",
|
||||
"RecraftTextToVectorNode",
|
||||
"RecraftVectorizeImageNode",
|
||||
"RegexExtract",
|
||||
"RegexMatch",
|
||||
"RenormCFG",
|
||||
"RepeatImageBatch",
|
||||
"RepeatLatentBatch",
|
||||
@@ -3625,11 +3739,13 @@
|
||||
"SaveAnimatedPNG",
|
||||
"SaveAnimatedWEBP",
|
||||
"SaveAudio",
|
||||
"SaveAudioMP3",
|
||||
"SaveAudioOpus",
|
||||
"SaveGLB",
|
||||
"SaveImage",
|
||||
"SaveImageWebsocket",
|
||||
"SaveLatent",
|
||||
"SaveSVG",
|
||||
"SaveSVGNode",
|
||||
"SaveVideo",
|
||||
"SaveWEBM",
|
||||
"SelfAttentionGuidance",
|
||||
@@ -3653,6 +3769,13 @@
|
||||
"StableCascade_SuperResolutionControlnet",
|
||||
"StableZero123_Conditioning",
|
||||
"StableZero123_Conditioning_Batched",
|
||||
"StringCompare",
|
||||
"StringConcatenate",
|
||||
"StringContains",
|
||||
"StringLength",
|
||||
"StringReplace",
|
||||
"StringSubstring",
|
||||
"StringTrim",
|
||||
"StubConstantImage",
|
||||
"StubFloat",
|
||||
"StubImage",
|
||||
@@ -3720,6 +3843,8 @@
|
||||
"VideoTriangleCFGGuidance",
|
||||
"VoxelToMesh",
|
||||
"VoxelToMeshBasic",
|
||||
"WanCameraEmbedding",
|
||||
"WanCameraImageToVideo",
|
||||
"WanFirstLastFrameToVideo",
|
||||
"WanFunControlToVideo",
|
||||
"WanFunInpaintToVideo",
|
||||
@@ -4037,6 +4162,8 @@
|
||||
"Alpha Crop and Position Image",
|
||||
"GenerateTimestamp",
|
||||
"GetMostCommonColors",
|
||||
"OpenAI Image 2 Text",
|
||||
"PadMask",
|
||||
"ReadImage",
|
||||
"RenderOpenStreetMapTile",
|
||||
"Shrink Image"
|
||||
@@ -4146,12 +4273,16 @@
|
||||
[
|
||||
"GagaAddStringArray",
|
||||
"GagaBatchStringReplace",
|
||||
"GagaGetDirList",
|
||||
"GagaGetFileList",
|
||||
"GagaGetImageInfoByUpload",
|
||||
"GagaGetImageInfoWithUrl",
|
||||
"GagaGetImageWithPath",
|
||||
"GagaGetStringArrayByIndex",
|
||||
"GagaGetStringArraySize",
|
||||
"GagaGetStringListSize",
|
||||
"GagaPythonScript",
|
||||
"GagaSaveImageToPath",
|
||||
"GagaSaveImageWithInfo",
|
||||
"GagaSaveImagesToGif",
|
||||
"GagaSplitStringToList",
|
||||
@@ -4263,6 +4394,7 @@
|
||||
[
|
||||
"CreatePointsString",
|
||||
"XISER_Canvas",
|
||||
"XIS_CanvasMaskProcessor",
|
||||
"XIS_CompositorProcessor",
|
||||
"XIS_CropImage",
|
||||
"XIS_DynamicBatchKSampler",
|
||||
@@ -4690,6 +4822,18 @@
|
||||
"title_aux": "ComfyUI PaintingCoderUtils Nodes [WIP]"
|
||||
}
|
||||
],
|
||||
"https://github.com/jax-explorer/ComfyUI-DreamO": [
|
||||
[
|
||||
"BgRmModelLoad",
|
||||
"DreamOGenerate",
|
||||
"DreamOLoadModel",
|
||||
"DreamOLoadModelFromLocal",
|
||||
"FaceModelLoad"
|
||||
],
|
||||
{
|
||||
"title_aux": "ComfyUI-DreamO"
|
||||
}
|
||||
],
|
||||
"https://github.com/jcomeme/ComfyUI-AsunaroTools": [
|
||||
[
|
||||
"AsunaroAnd",
|
||||
@@ -4846,6 +4990,7 @@
|
||||
],
|
||||
"https://github.com/jonnydolake/ComfyUI-AIR-Nodes": [
|
||||
[
|
||||
"BatchListToFlatList",
|
||||
"BrightnessContrastSaturation",
|
||||
"CombinedInbetweenInputs",
|
||||
"CreateFilenameList",
|
||||
@@ -4853,10 +4998,13 @@
|
||||
"DisplaceImageCPU",
|
||||
"DisplaceImageGPU",
|
||||
"ExtractBlackLines",
|
||||
"FlatListToBatchList",
|
||||
"ForceMinimumBatchSize",
|
||||
"GPUTargetLocationCrop",
|
||||
"GPUTargetLocationPaste",
|
||||
"GetImageFromList",
|
||||
"ImageCompositeChained",
|
||||
"JoinImageLists",
|
||||
"JoinStringLists",
|
||||
"LTXVAddGuideAIR",
|
||||
"LineDetection",
|
||||
@@ -4865,6 +5013,7 @@
|
||||
"MatchImageCountToMaskCount",
|
||||
"ParallaxTest",
|
||||
"RandomCharacterPrompts",
|
||||
"RemoveElementFromList",
|
||||
"TargetLocationCrop",
|
||||
"TargetLocationPaste",
|
||||
"easy_parallax",
|
||||
@@ -5094,6 +5243,8 @@
|
||||
"https://github.com/kijai/ComfyUI-HunyuanVideoWrapper": [
|
||||
[
|
||||
"DownloadAndLoadHyVideoTextEncoder",
|
||||
"HunyuanVideoFresca",
|
||||
"HunyuanVideoSLG",
|
||||
"HyVideoBlockSwap",
|
||||
"HyVideoCFG",
|
||||
"HyVideoContextOptions",
|
||||
@@ -5302,6 +5453,7 @@
|
||||
"FlowLoraLoaderModelOnly",
|
||||
"FlowModelManager",
|
||||
"FlowSaveImage",
|
||||
"QuadrupleCLIPLoaderGGUF",
|
||||
"TripleCLIPLoaderGGUF",
|
||||
"UnetLoaderGGUF",
|
||||
"UnetLoaderGGUFAdvanced"
|
||||
@@ -5609,6 +5761,7 @@
|
||||
"https://github.com/lucafoscili/lf-nodes": [
|
||||
[
|
||||
"LF_Blend",
|
||||
"LF_Bloom",
|
||||
"LF_BlurImages",
|
||||
"LF_Boolean",
|
||||
"LF_Brightness",
|
||||
@@ -5673,6 +5826,7 @@
|
||||
"LF_SaveImageForCivitAI",
|
||||
"LF_SaveJSON",
|
||||
"LF_SaveMarkdown",
|
||||
"LF_SaveText",
|
||||
"LF_SchedulerSelector",
|
||||
"LF_Sepia",
|
||||
"LF_SequentialSeedsGenerator",
|
||||
@@ -5681,6 +5835,8 @@
|
||||
"LF_Something2Number",
|
||||
"LF_Something2String",
|
||||
"LF_SortJSONKeys",
|
||||
"LF_SortTags",
|
||||
"LF_SplitTone",
|
||||
"LF_String",
|
||||
"LF_StringReplace",
|
||||
"LF_StringTemplate",
|
||||
@@ -5690,6 +5846,7 @@
|
||||
"LF_SwitchInteger",
|
||||
"LF_SwitchJSON",
|
||||
"LF_SwitchString",
|
||||
"LF_TiltShift",
|
||||
"LF_UpdateUsageStatistics",
|
||||
"LF_UpscaleModelSelector",
|
||||
"LF_UrandomSeedGenerator",
|
||||
@@ -5730,6 +5887,20 @@
|
||||
"title_aux": "comfyui-energycost"
|
||||
}
|
||||
],
|
||||
"https://github.com/maizerrr/comfyui-code-nodes": [
|
||||
[
|
||||
"BBoxDrawNode",
|
||||
"BBoxParseNode",
|
||||
"DummyNode",
|
||||
"ImageBatchNode",
|
||||
"MaskEditorNode",
|
||||
"OpenAIGPTImageNode",
|
||||
"OpenAIQueryNode"
|
||||
],
|
||||
{
|
||||
"title_aux": "comfyui-virallover"
|
||||
}
|
||||
],
|
||||
"https://github.com/majorsauce/comfyui_indieTools": [
|
||||
[
|
||||
"IndCutByMask",
|
||||
@@ -5810,6 +5981,17 @@
|
||||
"title_aux": "ComfyUI-MMYolo"
|
||||
}
|
||||
],
|
||||
"https://github.com/maurorilla/ComfyUI-MisterMR-Nodes": [
|
||||
[
|
||||
"AddLogo",
|
||||
"AddSingleObject",
|
||||
"AddSingleText",
|
||||
"ColorNode"
|
||||
],
|
||||
{
|
||||
"title_aux": "ComfyUI-glb-to-stl [WIP]"
|
||||
}
|
||||
],
|
||||
"https://github.com/mehbebe/ComfyLoraGallery": [
|
||||
[
|
||||
"LoraGallery"
|
||||
@@ -5827,22 +6009,6 @@
|
||||
"title_aux": "ComfyUI-Lygia"
|
||||
}
|
||||
],
|
||||
"https://github.com/mfg637/ComfyUI-ScheduledGuider-Ext": [
|
||||
[
|
||||
"ConcatSigmas",
|
||||
"CosineScheduler",
|
||||
"GaussianScheduler",
|
||||
"InvertSigmas",
|
||||
"LogNormal Scheduler",
|
||||
"OffsetSigmas",
|
||||
"PerpNegScheduledCFGGuider",
|
||||
"ScheduledCFGGuider",
|
||||
"SplitSigmasByValue"
|
||||
],
|
||||
{
|
||||
"title_aux": "ComfyUI-ScheduledGuider-Ext"
|
||||
}
|
||||
],
|
||||
"https://github.com/mikebilly/Transparent-background-comfyUI": [
|
||||
[
|
||||
"Transparentbackground RemBg"
|
||||
@@ -6136,10 +6302,28 @@
|
||||
"title_aux": "ComfyUI-PromptUtilities"
|
||||
}
|
||||
],
|
||||
"https://github.com/nobandegani/comfyui_ino_nodes": [
|
||||
[
|
||||
"Ino_BranchImage",
|
||||
"Ino_CountFiles",
|
||||
"Ino_DateTimeAsString",
|
||||
"Ino_GetParentID",
|
||||
"Ino_IntEqual",
|
||||
"Ino_NotBoolean",
|
||||
"Ino_ParseFilePath",
|
||||
"Ino_SaveFile",
|
||||
"Ino_SaveImage",
|
||||
"Ino_VideoConvert"
|
||||
],
|
||||
{
|
||||
"title_aux": "Ino Custom Nodes"
|
||||
}
|
||||
],
|
||||
"https://github.com/nomcycle/ComfyUI_Cluster": [
|
||||
[
|
||||
"ClusterBroadcastLoadedImage",
|
||||
"ClusterBroadcastTensor",
|
||||
"ClusterEndSubgraph",
|
||||
"ClusterExecuteCurrentWorkflow",
|
||||
"ClusterExecuteWorkflow",
|
||||
"ClusterFanInImages",
|
||||
@@ -6154,9 +6338,12 @@
|
||||
"ClusterGatherMasks",
|
||||
"ClusterGetInstanceWorkItemFromBatch",
|
||||
"ClusterInfo",
|
||||
"ClusterInsertAtIndex",
|
||||
"ClusterListenTensorBroadcast",
|
||||
"ClusterSplitBatchToList",
|
||||
"ClusterStridedReorder"
|
||||
"ClusterStartSubgraph",
|
||||
"ClusterStridedReorder",
|
||||
"ClusterUseSubgraph"
|
||||
],
|
||||
{
|
||||
"title_aux": "ComfyUI_Cluster [WIP]"
|
||||
@@ -6217,6 +6404,15 @@
|
||||
"title_aux": "Kosmos2_BBox_Cutter Models"
|
||||
}
|
||||
],
|
||||
"https://github.com/p1atdev/comfyui-aesthetic-predictor": [
|
||||
[
|
||||
"LoadAestheticPredictorNode",
|
||||
"PredictAestheticScore"
|
||||
],
|
||||
{
|
||||
"title_aux": "comfyui-aesthetic-predictor"
|
||||
}
|
||||
],
|
||||
"https://github.com/pamparamm/ComfyUI-ppm": [
|
||||
[
|
||||
"AttentionCouplePPM",
|
||||
@@ -6376,6 +6572,48 @@
|
||||
"title_aux": "comfyui-sd3-simple-simpletuner"
|
||||
}
|
||||
],
|
||||
"https://github.com/rakki194/ComfyUI_WolfSigmas": [
|
||||
[
|
||||
"GetImageSize",
|
||||
"LatentVisualizeDirect",
|
||||
"ListModelBlocks",
|
||||
"ModifyActivationsSVD",
|
||||
"VisualizeActivation",
|
||||
"WolfDCTNoise",
|
||||
"WolfDCTNoiseScriptableLatent",
|
||||
"WolfPlotSamplerStatsNode",
|
||||
"WolfProbeGetData",
|
||||
"WolfProbeSetup",
|
||||
"WolfSamplerScriptEvaluator",
|
||||
"WolfScriptableEmptyLatent",
|
||||
"WolfScriptableLatentAnalyzer",
|
||||
"WolfScriptableNoise",
|
||||
"WolfSigmaAddNoise",
|
||||
"WolfSigmaClampT0",
|
||||
"WolfSigmaClipValues",
|
||||
"WolfSigmaGeometricProgression",
|
||||
"WolfSigmaInsertValue",
|
||||
"WolfSigmaNormalizeRange",
|
||||
"WolfSigmaPolynomial",
|
||||
"WolfSigmaPowerTransform",
|
||||
"WolfSigmaQuantize",
|
||||
"WolfSigmaRespaceLogCosine",
|
||||
"WolfSigmaReverse",
|
||||
"WolfSigmaReverseAndRescale",
|
||||
"WolfSigmaScriptEvaluator",
|
||||
"WolfSigmaShiftAndScale",
|
||||
"WolfSigmaSlice",
|
||||
"WolfSigmaTanhGenerator",
|
||||
"WolfSigmasGet",
|
||||
"WolfSigmasSet",
|
||||
"WolfSigmasToJSON",
|
||||
"WolfSimpleSamplerScriptEvaluator",
|
||||
"WolfSimpleScriptableEmptyLatent"
|
||||
],
|
||||
{
|
||||
"title_aux": "ComfyUI_WolfSigmas [UNSAFE]"
|
||||
}
|
||||
],
|
||||
"https://github.com/ralonsobeas/ComfyUI-HDRConversion": [
|
||||
[
|
||||
"HDRConversion"
|
||||
@@ -6476,7 +6714,8 @@
|
||||
],
|
||||
"https://github.com/rickyars/sd-cn-animation": [
|
||||
[
|
||||
"SDCNAnimation"
|
||||
"SDCNAnimation",
|
||||
"SDCNAnimationAdvanced"
|
||||
],
|
||||
{
|
||||
"title_aux": "sd-cn-animation"
|
||||
@@ -6487,6 +6726,7 @@
|
||||
"Get Image Dimensions",
|
||||
"Pad Batch to 4n+1",
|
||||
"Resize Frame",
|
||||
"Slot Frame",
|
||||
"Threshold Image",
|
||||
"Trim Padded Batch"
|
||||
],
|
||||
@@ -6725,6 +6965,8 @@
|
||||
"https://github.com/silveroxides/ComfyUI_ReduxEmbedToolkit": [
|
||||
[
|
||||
"LoadReduxEmb",
|
||||
"LoadT5XXLEmb",
|
||||
"SaveCondsEmb",
|
||||
"SaveReduxEmb"
|
||||
],
|
||||
{
|
||||
@@ -6981,7 +7223,6 @@
|
||||
"CLIPTokenCounter",
|
||||
"GeminiNode",
|
||||
"KoboldCppApiNode",
|
||||
"KoboldCppLauncherNode",
|
||||
"LoraStrengthXYPlot"
|
||||
],
|
||||
{
|
||||
@@ -7140,6 +7381,14 @@
|
||||
"title_aux": "ComfyUI_Toolbox"
|
||||
}
|
||||
],
|
||||
"https://github.com/virallover/comfyui-virallover": [
|
||||
[
|
||||
"DownloadAndLoadLoraModelOnly"
|
||||
],
|
||||
{
|
||||
"title_aux": "comfyui-virallover"
|
||||
}
|
||||
],
|
||||
"https://github.com/vladp0727/Comfyui-with-Furniture": [
|
||||
[
|
||||
"GetMaskFromAlpha",
|
||||
@@ -7149,6 +7398,14 @@
|
||||
"title_aux": "ComfyUI Simple Image Tools [WIP]"
|
||||
}
|
||||
],
|
||||
"https://github.com/wTechArtist/ComfyUI_WWL_Florence2SAM2": [
|
||||
[
|
||||
"WWL_Florence2SAM2"
|
||||
],
|
||||
{
|
||||
"title_aux": "ComfyUI_WWL_Florence2SAM2"
|
||||
}
|
||||
],
|
||||
"https://github.com/walterFeng/ComfyUI-Image-Utils": [
|
||||
[
|
||||
"Calculate Image Brightness",
|
||||
@@ -7269,50 +7526,53 @@
|
||||
"title_aux": "CombineMasksNode"
|
||||
}
|
||||
],
|
||||
"https://github.com/xl0/q_tools": [
|
||||
[
|
||||
"PreviewModelMetadata",
|
||||
"QGaussianLatent",
|
||||
"QKSampler",
|
||||
"QLinearScheduler",
|
||||
"QLoadLatent",
|
||||
"QLoadLatentTimeline",
|
||||
"QPreviewLatent",
|
||||
"QSamplerCustom",
|
||||
"QSamplerEulerAncestral",
|
||||
"QUniformLatent"
|
||||
],
|
||||
{
|
||||
"title_aux": "q_tools"
|
||||
}
|
||||
],
|
||||
"https://github.com/xmarked-ai/ComfyUI_misc": [
|
||||
[
|
||||
"AceColorFixX",
|
||||
"AceFloatX",
|
||||
"AceIntegerX",
|
||||
"BLIPMatcherX",
|
||||
"BlendLatentsX",
|
||||
"CheckpointLoaderBNB_X",
|
||||
"CheckpointLoaderNF4_X",
|
||||
"ColorCorrectionX",
|
||||
"ColorSpaceConversionX",
|
||||
"ColorTransferNodeX",
|
||||
"CommonSourcesX",
|
||||
"ConstantColorX",
|
||||
"ConvexHullByMaskX",
|
||||
"DeepSeekX",
|
||||
"DepthDisplaceX",
|
||||
"DummyTestNodeX",
|
||||
"EmptyLatentX",
|
||||
"ExpressionsX",
|
||||
"FourCornerPinMaskX",
|
||||
"GaussianBlurX",
|
||||
"GaussianMaskBlurX",
|
||||
"HiDreamAttentionScaleAllBlocksWithIPAdapterNode",
|
||||
"IfConditionX",
|
||||
"ImageCompositionX",
|
||||
"ImageResizeX",
|
||||
"ImageTileSquare",
|
||||
"ImageUntileSquare",
|
||||
"KSamplerComboX",
|
||||
"LoopCloseX",
|
||||
"LoopOpenX",
|
||||
"LoraBatchSamplerX",
|
||||
"PixtralVisionX",
|
||||
"PixtralX",
|
||||
"RegionTesterNodeX",
|
||||
"RegionalPromptSamplerX",
|
||||
"RelightX",
|
||||
"RemoveBackgroundX",
|
||||
"SaveImageX",
|
||||
"SelectiveDepthLoraBlocksX",
|
||||
"SimpleBlockerX",
|
||||
"SimpleWD14TaggerX",
|
||||
"SplineImageMask",
|
||||
"UnetLoaderBNB_X",
|
||||
"WhiteBalanceX"
|
||||
],
|
||||
{
|
||||
@@ -7445,6 +7705,14 @@
|
||||
"title_aux": "ComfyUI_Lam"
|
||||
}
|
||||
],
|
||||
"https://github.com/yichengup/ComfyUI-YCNodes_Advance": [
|
||||
[
|
||||
"YC Color Match"
|
||||
],
|
||||
{
|
||||
"title_aux": "ComfyUI-YCNodes_Advance"
|
||||
}
|
||||
],
|
||||
"https://github.com/yichengup/Comfyui-NodeSpark": [
|
||||
[
|
||||
"ImageCircleWarp",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,87 @@
|
||||
},
|
||||
|
||||
|
||||
|
||||
{
|
||||
"author": "syaofox",
|
||||
"title": "ComfyUI_fnodes [REMOVED]",
|
||||
"reference": "https://github.com/syaofox/ComfyUI_fnodes",
|
||||
"files": [
|
||||
"https://github.com/syaofox/ComfyUI_fnodes"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "ComfyUI_fnodes is a collection of custom nodes designed for ComfyUI. These nodes provide additional functionality that can enhance your ComfyUI workflows.\nFile manipulation tools, Image resizing tools, IPAdapter tools, Image processing tools, Mask tools, Face analysis tools, Sampler tools, Miscellaneous tools"
|
||||
},
|
||||
{
|
||||
"author": "Hangover3832",
|
||||
"title": "ComfyUI-Hangover-Moondream [DEPRECATED]",
|
||||
"reference": "https://github.com/Hangover3832/ComfyUI-Hangover-Moondream",
|
||||
"files": [
|
||||
"https://github.com/Hangover3832/ComfyUI-Hangover-Moondream"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Moondream is a lightweight multimodal large language model.\n[w/WARN:Additional python code will be downloaded from huggingface and executed. You have to trust this creator if you want to use this node!]"
|
||||
},
|
||||
{
|
||||
"author": "Hangover3832",
|
||||
"title": "Recognize Anything Model (RAM) for ComfyUI [DEPRECATED]",
|
||||
"reference": "https://github.com/Hangover3832/ComfyUI-Hangover-Recognize_Anything",
|
||||
"files": [
|
||||
"https://github.com/Hangover3832/ComfyUI-Hangover-Recognize_Anything"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "This is an image recognition node for ComfyUI based on the RAM++ model from [a/xinyu1205](https://huggingface.co/xinyu1205).\nThis node outputs a string of tags with all the recognized objects and elements in the image in English or Chinese language.\nFor image tagging and captioning."
|
||||
},
|
||||
{
|
||||
"author": "Hangover3832",
|
||||
"title": "ComfyUI-Hangover-Nodes [DEPRECATED]",
|
||||
"reference": "https://github.com/Hangover3832/ComfyUI-Hangover-Nodes",
|
||||
"files": [
|
||||
"https://github.com/Hangover3832/ComfyUI-Hangover-Nodes"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Nodes: MS kosmos-2 Interrogator, Save Image w/o Metadata, Image Scale Bounding Box. An implementation of Microsoft [a/kosmos-2](https://huggingface.co/microsoft/kosmos-2-patch14-224) image to text transformer."
|
||||
},
|
||||
{
|
||||
"author": "SirLatore",
|
||||
"title": "ComfyUI-IPAdapterWAN [REMOVED]",
|
||||
"reference": "https://github.com/SirLatore/ComfyUI-IPAdapterWAN",
|
||||
"files": [
|
||||
"https://github.com/SirLatore/ComfyUI-IPAdapterWAN"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "This extension adapts the [a/InstantX IP-Adapter for SD3.5-Large](https://huggingface.co/InstantX/SD3.5-Large-IP-Adapter) to work with Wan 2.1 and other UNet-based video/image models in ComfyUI.\nUnlike the original SD3 version (which depends on joint_blocks from MMDiT), this version performs sampling-time identity conditioning by dynamically injecting into attention layers — making it compatible with models like Wan 2.1, AnimateDiff, and other non-SD3 pipelines."
|
||||
},
|
||||
{
|
||||
"author": "Jpzz",
|
||||
"title": "ComfyUI-VirtualInteraction [UNSAFE/REMOVED]",
|
||||
"reference": "https://github.com/Jpzz/ComfyUI-VirtualInteraction",
|
||||
"files": [
|
||||
"https://github.com/Jpzz/ComfyUI-VirtualInteraction"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES: virtual interaction custom node when using generative movie\n[w/This nodepack contains a node which is reading arbitrary excel file.]"
|
||||
},
|
||||
{
|
||||
"author": "satche",
|
||||
"title": "Prompt Factory [REMOVED]",
|
||||
"reference": "https://github.com/satche/comfyui-prompt-factory",
|
||||
"files": [
|
||||
"https://github.com/satche/comfyui-prompt-factory"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "A modular system that adds randomness to prompt generation"
|
||||
},
|
||||
{
|
||||
"author": "MITCAP",
|
||||
"title": "ComfyUI OpenAI DALL-E 3 Node [REMOVED]",
|
||||
"reference": "https://github.com/MITCAP/OpenAI-ComfyUI",
|
||||
"files": [
|
||||
"https://github.com/MITCAP/OpenAI-ComfyUI"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "This project provides custom nodes for ComfyUI that integrate with OpenAI's DALL-E 3 and GPT-4o models. The nodes allow users to generate images and describe images using OpenAI's API.\nNOTE: The files in the repo are not organized."
|
||||
},
|
||||
{
|
||||
"author": "raspie10032",
|
||||
"title": "ComfyUI NAI Prompt Converter [REMOVED]",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,50 @@
|
||||
{
|
||||
"models": [
|
||||
{
|
||||
"name": "Latent Bridge Matching for Image Relighting",
|
||||
"type": "diffusion_model",
|
||||
"base": "LBM",
|
||||
"save_path": "diffusion_models/LBM",
|
||||
"description": "Latent Bridge Matching (LBM) Relighting model",
|
||||
"reference": "https://huggingface.co/jasperai/LBM_relighting",
|
||||
"filename": "LBM_relighting.safetensors",
|
||||
"url": "https://huggingface.co/jasperai/LBM_relighting/resolve/main/model.safetensors",
|
||||
"size": "5.02GB"
|
||||
},
|
||||
|
||||
{
|
||||
"name": "LTX-Video 13B Distilled v0.9.7",
|
||||
"type": "checkpoint",
|
||||
"base": "LTX-Video",
|
||||
"save_path": "checkpoints/LTXV",
|
||||
"description": "Distilled version of the LTX-Video 13B model, providing improved efficiency while maintaining high-resolution quality.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-Video",
|
||||
"filename": "ltxv-13b-0.9.7-distilled.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-Video/resolve/main/ltxv-13b-0.9.7-distilled.safetensors",
|
||||
"size": "28.6GB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-Video 13B Distilled FP8 v0.9.7",
|
||||
"type": "checkpoint",
|
||||
"base": "LTX-Video",
|
||||
"save_path": "checkpoints/LTXV",
|
||||
"description": "Quantized distilled version of the LTX-Video 13B model, optimized for even lower VRAM usage while maintaining quality.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-Video",
|
||||
"filename": "ltxv-13b-0.9.7-distilled-fp8.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-Video/resolve/main/ltxv-13b-0.9.7-distilled-fp8.safetensors",
|
||||
"size": "15.7GB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-Video 13B Distilled LoRA v0.9.7",
|
||||
"type": "lora",
|
||||
"base": "LTX-Video",
|
||||
"save_path": "loras",
|
||||
"description": "A LoRA adapter that transforms the standard LTX-Video 13B model into a distilled version when loaded.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-Video",
|
||||
"filename": "ltxv-13b-0.9.7-distilled-lora128.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-Video/resolve/main/ltxv-13b-0.9.7-distilled-lora128.safetensors",
|
||||
"size": "1.33GB"
|
||||
},
|
||||
{
|
||||
"name": "lllyasviel/FramePackI2V_HY",
|
||||
"type": "FramePackI2V",
|
||||
@@ -646,52 +691,6 @@
|
||||
"filename": "sigclip_vision_patch14_384.safetensors",
|
||||
"url": "https://huggingface.co/Comfy-Org/sigclip_vision_384/resolve/main/sigclip_vision_patch14_384.safetensors",
|
||||
"size": "857MB"
|
||||
},
|
||||
|
||||
{
|
||||
"name": "comfyanonymous/flux_text_encoders - t5xxl (fp16)",
|
||||
"type": "clip",
|
||||
"base": "t5",
|
||||
"save_path": "text_encoders/t5",
|
||||
"description": "Text Encoders for FLUX (fp16)",
|
||||
"reference": "https://huggingface.co/comfyanonymous/flux_text_encoders",
|
||||
"filename": "t5xxl_fp16.safetensors",
|
||||
"url": "https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp16.safetensors",
|
||||
"size": "9.79GB"
|
||||
},
|
||||
{
|
||||
"name": "comfyanonymous/flux_text_encoders - t5xxl (fp8_e4m3fn)",
|
||||
"type": "clip",
|
||||
"base": "t5",
|
||||
"save_path": "text_encoders/t5",
|
||||
"description": "Text Encoders for FLUX (fp8_e4m3fn)",
|
||||
"reference": "https://huggingface.co/comfyanonymous/flux_text_encoders",
|
||||
"filename": "t5xxl_fp8_e4m3fn.safetensors",
|
||||
"url": "https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp8_e4m3fn.safetensors",
|
||||
"size": "4.89GB"
|
||||
},
|
||||
{
|
||||
"name": "comfyanonymous/flux_text_encoders - t5xxl (fp8_e4m3fn_scaled)",
|
||||
"type": "clip",
|
||||
"base": "t5",
|
||||
"save_path": "text_encoders/t5",
|
||||
"description": "Text Encoders for FLUX (fp16)",
|
||||
"reference": "https://huggingface.co/comfyanonymous/flux_text_encoders",
|
||||
"filename": "t5xxl_fp8_e4m3fn_scaled.safetensors",
|
||||
"url": "https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp8_e4m3fn_scaled.safetensors",
|
||||
"size": "5.16GB"
|
||||
},
|
||||
|
||||
{
|
||||
"name": "FLUX.1 [Dev] Diffusion model (scaled fp8)",
|
||||
"type": "diffusion_model",
|
||||
"base": "FLUX.1",
|
||||
"save_path": "diffusion_models/FLUX1",
|
||||
"description": "FLUX.1 [Dev] Diffusion model (scaled fp8)[w/Due to the large size of the model, it is recommended to download it through a browser if possible.]",
|
||||
"reference": "https://huggingface.co/comfyanonymous/flux_dev_scaled_fp8_test",
|
||||
"filename": "flux_dev_fp8_scaled_diffusion_model.safetensors",
|
||||
"url": "https://huggingface.co/comfyanonymous/flux_dev_scaled_fp8_test/resolve/main/flux_dev_fp8_scaled_diffusion_model.safetensors",
|
||||
"size": "11.9GB"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
{
|
||||
"custom_nodes": [
|
||||
{
|
||||
"author": "Comfy-Org",
|
||||
"title": "ComfyUI React Extension Template",
|
||||
"reference": "https://github.com/Comfy-Org/ComfyUI-React-Extension-Template",
|
||||
"files": [
|
||||
"https://github.com/Comfy-Org/ComfyUI-React-Extension-Template"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "A minimal template for creating React/TypeScript frontend extensions for ComfyUI, with complete boilerplate setup including internationalization and unit testing."
|
||||
},
|
||||
{
|
||||
"author": "Suzie1",
|
||||
"title": "Guide To Making Custom Nodes in ComfyUI",
|
||||
|
||||
@@ -121,11 +121,17 @@ read_config()
|
||||
read_uv_mode()
|
||||
check_file_logging()
|
||||
|
||||
cm_global.pip_overrides = {'numpy': 'numpy<2'}
|
||||
if sys.version_info < (3, 13):
|
||||
cm_global.pip_overrides = {'numpy': 'numpy<2'}
|
||||
else:
|
||||
cm_global.pip_overrides = {}
|
||||
|
||||
if os.path.exists(manager_pip_overrides_path):
|
||||
with open(manager_pip_overrides_path, 'r', encoding="UTF-8", errors="ignore") as json_file:
|
||||
cm_global.pip_overrides = json.load(json_file)
|
||||
cm_global.pip_overrides['numpy'] = 'numpy<2'
|
||||
|
||||
if sys.version_info < (3, 13):
|
||||
cm_global.pip_overrides['numpy'] = 'numpy<2'
|
||||
|
||||
|
||||
if os.path.exists(manager_pip_blacklist_path):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-manager"
|
||||
description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI."
|
||||
version = "3.32"
|
||||
version = "3.32.3"
|
||||
license = { file = "LICENSE.txt" }
|
||||
dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions", "toml", "uv", "chardet"]
|
||||
|
||||
|
||||
19
tests-api/.gitignore
vendored
Normal file
19
tests-api/.gitignore
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# Python cache files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# Pytest cache
|
||||
.pytest_cache/
|
||||
|
||||
# Coverage reports
|
||||
.coverage
|
||||
htmlcov/
|
||||
|
||||
# Virtual environments
|
||||
venv/
|
||||
env/
|
||||
ENV/
|
||||
|
||||
# Test-specific resources
|
||||
resources/tmp/
|
||||
91
tests-api/README.md
Normal file
91
tests-api/README.md
Normal file
@@ -0,0 +1,91 @@
|
||||
# ComfyUI-Manager API Tests
|
||||
|
||||
This directory contains tests for the ComfyUI-Manager API endpoints, validating the OpenAPI specification and ensuring API functionality.
|
||||
|
||||
## Setup
|
||||
|
||||
1. Install test dependencies:
|
||||
|
||||
```bash
|
||||
pip install -r requirements-test.txt
|
||||
```
|
||||
|
||||
2. Ensure ComfyUI is running with ComfyUI-Manager installed:
|
||||
|
||||
```bash
|
||||
# Start ComfyUI with the default server
|
||||
python main.py
|
||||
```
|
||||
|
||||
## Running Tests
|
||||
|
||||
### Run all tests
|
||||
|
||||
```bash
|
||||
pytest -xvs
|
||||
```
|
||||
|
||||
### Run specific test files
|
||||
|
||||
```bash
|
||||
# Run only the spec validation tests
|
||||
pytest -xvs test_spec_validation.py
|
||||
|
||||
# Run only the custom node API tests
|
||||
pytest -xvs test_customnode_api.py
|
||||
```
|
||||
|
||||
### Run specific test functions
|
||||
|
||||
```bash
|
||||
# Run a specific test
|
||||
pytest -xvs test_customnode_api.py::test_get_custom_node_list
|
||||
```
|
||||
|
||||
## Test Configuration
|
||||
|
||||
The tests use the following default configuration:
|
||||
|
||||
- Server URL: `http://localhost:8188`
|
||||
- Server timeout: 2 seconds
|
||||
- Wait between requests: 0.5 seconds
|
||||
- Maximum retries: 3
|
||||
|
||||
You can override these settings with environment variables:
|
||||
|
||||
```bash
|
||||
# Use a different server URL
|
||||
COMFYUI_SERVER_URL=http://localhost:8189 pytest -xvs
|
||||
```
|
||||
|
||||
## Test Categories
|
||||
|
||||
The tests are organized into the following categories:
|
||||
|
||||
1. **Spec Validation** (`test_spec_validation.py`): Validates that the OpenAPI specification is correct and complete.
|
||||
2. **Custom Node API** (`test_customnode_api.py`): Tests for custom node management endpoints.
|
||||
3. **Snapshot API** (`test_snapshot_api.py`): Tests for snapshot management endpoints.
|
||||
4. **Queue API** (`test_queue_api.py`): Tests for queue management endpoints.
|
||||
5. **Config API** (`test_config_api.py`): Tests for configuration endpoints.
|
||||
6. **Model API** (`test_model_api.py`): Tests for model management endpoints (minimal as these are being deprecated).
|
||||
|
||||
## Test Implementation Details
|
||||
|
||||
### Fixtures
|
||||
|
||||
- `test_config`: Provides the test configuration
|
||||
- `server_url`: Returns the server URL from the configuration
|
||||
- `openapi_spec`: Loads the OpenAPI specification
|
||||
- `api_client`: Creates a requests Session for API calls
|
||||
- `api_request`: Helper function for making consistent API requests
|
||||
|
||||
### Utilities
|
||||
|
||||
- `validation.py`: Functions for validating responses against the OpenAPI schema
|
||||
- `schema_utils.py`: Utilities for extracting and manipulating schemas
|
||||
|
||||
## Notes
|
||||
|
||||
- Some tests are skipped with `@pytest.mark.skip` to avoid modifying state in automated testing
|
||||
- Security-level restricted endpoints have minimal tests to avoid security issues
|
||||
- Tests focus on read operations rather than write operations where possible
|
||||
1
tests-api/__init__.py
Normal file
1
tests-api/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# Make tests-api directory a proper package
|
||||
237
tests-api/conftest.py
Normal file
237
tests-api/conftest.py
Normal file
@@ -0,0 +1,237 @@
|
||||
"""
|
||||
PyTest configuration and fixtures for API tests.
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import pytest
|
||||
import requests
|
||||
import tempfile
|
||||
import time
|
||||
import yaml
|
||||
from pathlib import Path
|
||||
from typing import Dict, Generator, Optional, Tuple
|
||||
|
||||
# Import test utilities
|
||||
import sys
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
# Get the absolute path to the current file (conftest.py)
|
||||
current_file = Path(os.path.abspath(__file__))
|
||||
|
||||
# Get the directory containing the current file (the tests-api directory)
|
||||
tests_api_dir = current_file.parent
|
||||
|
||||
# Add the tests-api directory to the Python path
|
||||
if str(tests_api_dir) not in sys.path:
|
||||
sys.path.insert(0, str(tests_api_dir))
|
||||
|
||||
# Apply mocks for ComfyUI imports
|
||||
from mocks.patch import apply_mocks
|
||||
apply_mocks()
|
||||
|
||||
# Now we can import from utils.validation
|
||||
from utils.validation import load_openapi_spec
|
||||
|
||||
|
||||
# Default test configuration
|
||||
DEFAULT_TEST_CONFIG = {
|
||||
"server_url": "http://localhost:8188",
|
||||
"server_timeout": 2, # seconds
|
||||
"wait_between_requests": 0.5, # seconds
|
||||
"max_retries": 3,
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def test_config() -> Dict:
|
||||
"""
|
||||
Load test configuration from environment variables or use defaults.
|
||||
"""
|
||||
config = DEFAULT_TEST_CONFIG.copy()
|
||||
|
||||
# Override from environment variables if present
|
||||
if "COMFYUI_SERVER_URL" in os.environ:
|
||||
config["server_url"] = os.environ["COMFYUI_SERVER_URL"]
|
||||
|
||||
return config
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def server_url(test_config: Dict) -> str:
|
||||
"""
|
||||
Get the server URL from the test configuration.
|
||||
"""
|
||||
return test_config["server_url"]
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def openapi_spec() -> Dict:
|
||||
"""
|
||||
Load the OpenAPI specification.
|
||||
"""
|
||||
return load_openapi_spec()
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def api_client(server_url: str, test_config: Dict) -> requests.Session:
|
||||
"""
|
||||
Create a requests Session for API calls.
|
||||
"""
|
||||
session = requests.Session()
|
||||
|
||||
# Check if the server is running
|
||||
try:
|
||||
response = session.get(f"{server_url}/", timeout=test_config["server_timeout"])
|
||||
response.raise_for_status()
|
||||
except (requests.ConnectionError, requests.Timeout, requests.HTTPError):
|
||||
pytest.skip("ComfyUI server is not running or not accessible")
|
||||
|
||||
return session
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def temp_dir() -> Generator[Path, None, None]:
|
||||
"""
|
||||
Create a temporary directory for test files.
|
||||
"""
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
yield Path(temp_dir)
|
||||
|
||||
|
||||
class SecurityLevelContext:
|
||||
"""
|
||||
Context manager for setting and restoring security levels.
|
||||
"""
|
||||
def __init__(self, api_client: requests.Session, server_url: str, security_level: str):
|
||||
self.api_client = api_client
|
||||
self.server_url = server_url
|
||||
self.security_level = security_level
|
||||
self.original_level = None
|
||||
|
||||
async def __aenter__(self):
|
||||
# Get the current security level (not directly exposed in API, would require more setup)
|
||||
# For now, we'll just set the new level
|
||||
|
||||
# Set the new security level
|
||||
# Note: In a real implementation, we would need a way to set this
|
||||
# This is a placeholder - the actual implementation would depend on how
|
||||
# security levels are managed in ComfyUI-Manager
|
||||
return self
|
||||
|
||||
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
||||
# Restore the original security level if needed
|
||||
pass
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def security_level_context(api_client: requests.Session, server_url: str):
|
||||
"""
|
||||
Create a context manager for setting security levels.
|
||||
"""
|
||||
return lambda level: SecurityLevelContext(api_client, server_url, level)
|
||||
|
||||
|
||||
def make_api_url(server_url: str, path: str) -> str:
|
||||
"""
|
||||
Construct a full API URL from the server URL and path.
|
||||
"""
|
||||
# Ensure the path starts with a slash
|
||||
if not path.startswith("/"):
|
||||
path = f"/{path}"
|
||||
|
||||
# Remove trailing slash from server_url if present
|
||||
if server_url.endswith("/"):
|
||||
server_url = server_url[:-1]
|
||||
|
||||
return f"{server_url}{path}"
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def api_request(api_client: requests.Session, server_url: str, test_config: Dict):
|
||||
"""
|
||||
Helper function for making API requests with consistent behavior.
|
||||
"""
|
||||
def _request(
|
||||
method: str,
|
||||
path: str,
|
||||
params: Optional[Dict] = None,
|
||||
json_data: Optional[Dict] = None,
|
||||
headers: Optional[Dict] = None,
|
||||
expected_status: int = 200,
|
||||
retry_on_error: bool = True,
|
||||
) -> Tuple[requests.Response, Optional[Dict]]:
|
||||
"""
|
||||
Make an API request with automatic validation.
|
||||
|
||||
Args:
|
||||
method: HTTP method
|
||||
path: API path
|
||||
params: Query parameters
|
||||
json_data: JSON request body
|
||||
headers: HTTP headers
|
||||
expected_status: Expected HTTP status code
|
||||
retry_on_error: Whether to retry on connection errors
|
||||
|
||||
Returns:
|
||||
Tuple of (Response object, JSON response data or None)
|
||||
"""
|
||||
method = method.lower()
|
||||
url = make_api_url(server_url, path)
|
||||
|
||||
if headers is None:
|
||||
headers = {}
|
||||
|
||||
# Add common headers
|
||||
headers.setdefault("Accept", "application/json")
|
||||
|
||||
# Sleep between requests to avoid overwhelming the server
|
||||
time.sleep(test_config["wait_between_requests"])
|
||||
|
||||
retries = test_config["max_retries"] if retry_on_error else 0
|
||||
last_exception = None
|
||||
|
||||
for attempt in range(retries + 1):
|
||||
try:
|
||||
if method == "get":
|
||||
response = api_client.get(url, params=params, headers=headers)
|
||||
elif method == "post":
|
||||
response = api_client.post(url, params=params, json=json_data, headers=headers)
|
||||
elif method == "put":
|
||||
response = api_client.put(url, params=params, json=json_data, headers=headers)
|
||||
elif method == "delete":
|
||||
response = api_client.delete(url, params=params, headers=headers)
|
||||
else:
|
||||
raise ValueError(f"Unsupported HTTP method: {method}")
|
||||
|
||||
# Check status code
|
||||
assert response.status_code == expected_status, (
|
||||
f"Expected status code {expected_status}, got {response.status_code}"
|
||||
)
|
||||
|
||||
# Parse JSON response if possible
|
||||
json_response = None
|
||||
if response.headers.get("Content-Type", "").startswith("application/json"):
|
||||
try:
|
||||
json_response = response.json()
|
||||
except json.JSONDecodeError:
|
||||
if expected_status == 200:
|
||||
raise ValueError("Response was not valid JSON")
|
||||
|
||||
return response, json_response
|
||||
|
||||
except (requests.ConnectionError, requests.Timeout) as e:
|
||||
last_exception = e
|
||||
if attempt < retries:
|
||||
# Wait before retrying
|
||||
time.sleep(1)
|
||||
continue
|
||||
break
|
||||
|
||||
if last_exception:
|
||||
raise last_exception
|
||||
|
||||
raise RuntimeError("Failed to make API request")
|
||||
|
||||
return _request
|
||||
1
tests-api/mocks/__init__.py
Normal file
1
tests-api/mocks/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# Make tests-api/mocks directory a proper package
|
||||
26
tests-api/mocks/custom_node_manager.py
Normal file
26
tests-api/mocks/custom_node_manager.py
Normal file
@@ -0,0 +1,26 @@
|
||||
"""
|
||||
Mock CustomNodeManager for testing purposes
|
||||
"""
|
||||
|
||||
class CustomNodeManager:
|
||||
"""
|
||||
Mock implementation of the CustomNodeManager class
|
||||
"""
|
||||
instance = None
|
||||
|
||||
def __init__(self):
|
||||
self.custom_nodes = {}
|
||||
self.node_paths = []
|
||||
self.refresh_timeout = None
|
||||
|
||||
def get_node_path(self, node_class):
|
||||
"""
|
||||
Mock implementation to get the path for a node class
|
||||
"""
|
||||
return self.custom_nodes.get(node_class, None)
|
||||
|
||||
def update_node_paths(self):
|
||||
"""
|
||||
Mock implementation to update node paths
|
||||
"""
|
||||
pass
|
||||
116
tests-api/mocks/patch.py
Normal file
116
tests-api/mocks/patch.py
Normal file
@@ -0,0 +1,116 @@
|
||||
"""
|
||||
Patch module to mock imports for testing
|
||||
"""
|
||||
import sys
|
||||
import importlib.util
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
# Import mock modules
|
||||
from mocks.prompt_server import PromptServer
|
||||
from mocks.custom_node_manager import CustomNodeManager
|
||||
|
||||
# Current directory
|
||||
current_dir = Path(__file__).parent.parent # tests-api directory
|
||||
|
||||
# Define mocks
|
||||
class MockModule:
|
||||
"""Base class for mock modules"""
|
||||
pass
|
||||
|
||||
# Create server mock module with PromptServer
|
||||
server_mock = MockModule()
|
||||
server_mock.PromptServer = PromptServer
|
||||
prompt_server_instance = PromptServer()
|
||||
server_mock.PromptServer.instance = prompt_server_instance
|
||||
server_mock.PromptServer.inst = prompt_server_instance
|
||||
|
||||
# Create app mock module with custom_node_manager submodule
|
||||
app_mock = MockModule()
|
||||
app_custom_node_manager = MockModule()
|
||||
app_custom_node_manager.CustomNodeManager = CustomNodeManager
|
||||
app_custom_node_manager.CustomNodeManager.instance = CustomNodeManager()
|
||||
|
||||
# Create utils mock module with json_util submodule
|
||||
utils_mock = MockModule()
|
||||
utils_json_util = MockModule()
|
||||
|
||||
# Create utils.validation and utils.schema_utils submodules
|
||||
utils_validation = MockModule()
|
||||
utils_schema_utils = MockModule()
|
||||
|
||||
# Import actual modules (make sure path is set up correctly)
|
||||
sys.path.insert(0, str(current_dir))
|
||||
|
||||
try:
|
||||
# Import the validation module
|
||||
from utils.validation import load_openapi_spec
|
||||
utils_validation.load_openapi_spec = load_openapi_spec
|
||||
|
||||
# Import all schema_utils functions
|
||||
from utils.schema_utils import (
|
||||
get_all_paths,
|
||||
get_grouped_paths,
|
||||
get_methods_for_path,
|
||||
find_paths_with_security,
|
||||
get_content_types_for_response,
|
||||
get_required_parameters
|
||||
)
|
||||
|
||||
utils_schema_utils.get_all_paths = get_all_paths
|
||||
utils_schema_utils.get_grouped_paths = get_grouped_paths
|
||||
utils_schema_utils.get_methods_for_path = get_methods_for_path
|
||||
utils_schema_utils.find_paths_with_security = find_paths_with_security
|
||||
utils_schema_utils.get_content_types_for_response = get_content_types_for_response
|
||||
utils_schema_utils.get_required_parameters = get_required_parameters
|
||||
|
||||
except ImportError as e:
|
||||
print(f"Error importing test utilities: {e}")
|
||||
# Define dummy functions if imports fail
|
||||
def dummy_load_openapi_spec():
|
||||
"""Dummy function for testing"""
|
||||
return {"paths": {}}
|
||||
utils_validation.load_openapi_spec = dummy_load_openapi_spec
|
||||
|
||||
def dummy_get_all_paths(spec):
|
||||
return list(spec.get("paths", {}).keys())
|
||||
utils_schema_utils.get_all_paths = dummy_get_all_paths
|
||||
|
||||
def dummy_get_grouped_paths(spec):
|
||||
return {}
|
||||
utils_schema_utils.get_grouped_paths = dummy_get_grouped_paths
|
||||
|
||||
def dummy_get_methods_for_path(spec, path):
|
||||
return []
|
||||
utils_schema_utils.get_methods_for_path = dummy_get_methods_for_path
|
||||
|
||||
def dummy_find_paths_with_security(spec, security_scheme=None):
|
||||
return []
|
||||
utils_schema_utils.find_paths_with_security = dummy_find_paths_with_security
|
||||
|
||||
def dummy_get_content_types_for_response(spec, path, method, status_code="200"):
|
||||
return []
|
||||
utils_schema_utils.get_content_types_for_response = dummy_get_content_types_for_response
|
||||
|
||||
def dummy_get_required_parameters(spec, path, method):
|
||||
return []
|
||||
utils_schema_utils.get_required_parameters = dummy_get_required_parameters
|
||||
|
||||
# Add merge_json_recursive from our mock utils
|
||||
from mocks.utils import merge_json_recursive
|
||||
utils_json_util.merge_json_recursive = merge_json_recursive
|
||||
|
||||
# Apply the mocks to sys.modules
|
||||
def apply_mocks():
|
||||
"""Apply all mocks to sys.modules"""
|
||||
sys.modules['server'] = server_mock
|
||||
sys.modules['app'] = app_mock
|
||||
sys.modules['app.custom_node_manager'] = app_custom_node_manager
|
||||
sys.modules['utils'] = utils_mock
|
||||
sys.modules['utils.json_util'] = utils_json_util
|
||||
sys.modules['utils.validation'] = utils_validation
|
||||
sys.modules['utils.schema_utils'] = utils_schema_utils
|
||||
|
||||
# Make sure our actual utils module is importable
|
||||
if current_dir not in sys.path:
|
||||
sys.path.insert(0, str(current_dir))
|
||||
71
tests-api/mocks/prompt_server.py
Normal file
71
tests-api/mocks/prompt_server.py
Normal file
@@ -0,0 +1,71 @@
|
||||
"""
|
||||
Mock PromptServer for testing purposes
|
||||
"""
|
||||
|
||||
class MockRoutes:
|
||||
"""
|
||||
Mock routing class with method decorators
|
||||
"""
|
||||
def __init__(self):
|
||||
self.routes = {}
|
||||
|
||||
def get(self, path):
|
||||
"""Decorator for GET routes"""
|
||||
def decorator(f):
|
||||
self.routes[('GET', path)] = f
|
||||
return f
|
||||
return decorator
|
||||
|
||||
def post(self, path):
|
||||
"""Decorator for POST routes"""
|
||||
def decorator(f):
|
||||
self.routes[('POST', path)] = f
|
||||
return f
|
||||
return decorator
|
||||
|
||||
def put(self, path):
|
||||
"""Decorator for PUT routes"""
|
||||
def decorator(f):
|
||||
self.routes[('PUT', path)] = f
|
||||
return f
|
||||
return decorator
|
||||
|
||||
def delete(self, path):
|
||||
"""Decorator for DELETE routes"""
|
||||
def decorator(f):
|
||||
self.routes[('DELETE', path)] = f
|
||||
return f
|
||||
return decorator
|
||||
|
||||
|
||||
class PromptServer:
|
||||
"""
|
||||
Mock implementation of the PromptServer class
|
||||
"""
|
||||
instance = None
|
||||
inst = None
|
||||
|
||||
def __init__(self):
|
||||
self.routes = MockRoutes()
|
||||
self.registered_paths = set()
|
||||
self.base_url = "http://127.0.0.1:8188" # Assuming server is running on default port
|
||||
self.queue_lock = None
|
||||
|
||||
def add_route(self, method, path, handler, *args, **kwargs):
|
||||
"""
|
||||
Add a mock route to the server
|
||||
"""
|
||||
self.routes.routes[(method.upper(), path)] = handler
|
||||
self.registered_paths.add(path)
|
||||
|
||||
async def send_msg(self, message, data=None):
|
||||
"""
|
||||
Mock send_msg method (does nothing in the mock)
|
||||
"""
|
||||
pass
|
||||
|
||||
def send_sync(self, message, data=None):
|
||||
"""
|
||||
Mock send_sync method (does nothing in the mock)
|
||||
"""
|
||||
pass
|
||||
20
tests-api/mocks/utils.py
Normal file
20
tests-api/mocks/utils.py
Normal file
@@ -0,0 +1,20 @@
|
||||
"""
|
||||
Mock utils module for testing purposes
|
||||
"""
|
||||
|
||||
def merge_json_recursive(a, b):
|
||||
"""
|
||||
Mock implementation of merge_json_recursive
|
||||
"""
|
||||
if isinstance(a, dict) and isinstance(b, dict):
|
||||
result = a.copy()
|
||||
for key, value in b.items():
|
||||
if key in result and isinstance(result[key], (dict, list)) and isinstance(value, (dict, list)):
|
||||
result[key] = merge_json_recursive(result[key], value)
|
||||
else:
|
||||
result[key] = value
|
||||
return result
|
||||
elif isinstance(a, list) and isinstance(b, list):
|
||||
return a + b
|
||||
else:
|
||||
return b
|
||||
382
tests-api/openapi.yaml
Normal file
382
tests-api/openapi.yaml
Normal file
@@ -0,0 +1,382 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: ComfyUI-Manager API
|
||||
description: API for managing ComfyUI extensions, custom nodes, and models
|
||||
version: 1.0.0
|
||||
contact:
|
||||
name: ComfyUI Community
|
||||
url: https://github.com/comfyanonymous/ComfyUI
|
||||
|
||||
servers:
|
||||
- url: http://localhost:8188
|
||||
description: Local ComfyUI server
|
||||
|
||||
paths:
|
||||
/customnode/getlist:
|
||||
get:
|
||||
summary: Get the list of custom nodes
|
||||
description: Returns the list of custom nodes from all configured channels
|
||||
parameters:
|
||||
- name: mode
|
||||
in: query
|
||||
description: "The mode to retrieve (local=installed nodes, remote=available nodes)"
|
||||
schema:
|
||||
type: string
|
||||
enum: [local, remote]
|
||||
default: remote
|
||||
responses:
|
||||
'200':
|
||||
description: List of custom nodes
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
nodes:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/CustomNode'
|
||||
'500':
|
||||
description: Server error
|
||||
|
||||
/customnode/get_node_mappings:
|
||||
get:
|
||||
summary: Get mappings between node class names and their custom nodes
|
||||
description: Returns mappings that help identify which custom node package provides specific node classes
|
||||
parameters:
|
||||
- name: mode
|
||||
in: query
|
||||
description: "The mode for mappings (local=installed nodes, nickname=node nicknames)"
|
||||
schema:
|
||||
type: string
|
||||
enum: [local, nickname]
|
||||
default: local
|
||||
required: true
|
||||
responses:
|
||||
'200':
|
||||
description: Node mappings
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
'500':
|
||||
description: Server error
|
||||
|
||||
/customnode/get_node_alternatives:
|
||||
get:
|
||||
summary: Get alternative nodes for specific node classes
|
||||
description: Returns alternative implementations of node classes from different custom node packages
|
||||
parameters:
|
||||
- name: mode
|
||||
in: query
|
||||
description: "The mode to retrieve alternatives (local=installed nodes, remote=all available nodes)"
|
||||
schema:
|
||||
type: string
|
||||
enum: [local, remote]
|
||||
default: remote
|
||||
responses:
|
||||
'200':
|
||||
description: Node alternatives
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
'500':
|
||||
description: Server error
|
||||
|
||||
/externalmodel/getlist:
|
||||
get:
|
||||
summary: Get the list of external models
|
||||
description: Returns the list of models from all configured channels
|
||||
parameters:
|
||||
- name: mode
|
||||
in: query
|
||||
description: "The mode to retrieve (local=installed models, remote=available models)"
|
||||
schema:
|
||||
type: string
|
||||
enum: [local, remote]
|
||||
default: remote
|
||||
responses:
|
||||
'200':
|
||||
description: List of external models
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
models:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ExternalModel'
|
||||
'500':
|
||||
description: Server error
|
||||
|
||||
/manager/get_config:
|
||||
get:
|
||||
summary: Get manager configuration
|
||||
description: Returns the current configuration of ComfyUI-Manager
|
||||
parameters:
|
||||
- name: key
|
||||
in: query
|
||||
description: "The configuration key to retrieve"
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
responses:
|
||||
'200':
|
||||
description: Configuration value
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
value:
|
||||
type: string
|
||||
'400':
|
||||
description: Invalid key or missing parameter
|
||||
'500':
|
||||
description: Server error
|
||||
|
||||
/manager/set_config:
|
||||
post:
|
||||
summary: Set manager configuration
|
||||
description: Updates the configuration of ComfyUI-Manager
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- key
|
||||
- value
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
description: "The configuration key to update"
|
||||
value:
|
||||
type: string
|
||||
description: "The new value for the configuration key"
|
||||
responses:
|
||||
'200':
|
||||
description: Configuration updated successfully
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: boolean
|
||||
'400':
|
||||
description: Invalid key or value
|
||||
'500':
|
||||
description: Server error
|
||||
|
||||
/snapshot/getlist:
|
||||
get:
|
||||
summary: Get the list of snapshots
|
||||
description: Returns the list of saved snapshots
|
||||
responses:
|
||||
'200':
|
||||
description: List of snapshots
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
snapshots:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Snapshot'
|
||||
'500':
|
||||
description: Server error
|
||||
|
||||
/comfyui_manager/queue/status:
|
||||
get:
|
||||
summary: Get queue status
|
||||
description: Returns the current status of the operation queue
|
||||
responses:
|
||||
'200':
|
||||
description: Queue status
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/QueueStatus'
|
||||
'500':
|
||||
description: Server error
|
||||
|
||||
components:
|
||||
schemas:
|
||||
CustomNode:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- title
|
||||
- reference
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: "Internal name/ID of the custom node"
|
||||
title:
|
||||
type: string
|
||||
description: "Display title of the custom node"
|
||||
reference:
|
||||
type: string
|
||||
description: "Reference URL (usually GitHub repository URL)"
|
||||
description:
|
||||
type: string
|
||||
description: "Description of what the custom node does"
|
||||
install_type:
|
||||
type: string
|
||||
enum: [git, pip, copy]
|
||||
description: "Installation method for the custom node"
|
||||
files:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: "List of files provided by this custom node"
|
||||
node_class_names:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: "List of node class names provided by this custom node"
|
||||
installed:
|
||||
type: boolean
|
||||
description: "Whether the custom node is installed"
|
||||
version:
|
||||
type: string
|
||||
description: "Version of the custom node"
|
||||
tags:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: "Tags associated with the custom node"
|
||||
|
||||
ExternalModel:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
- url
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: "Name of the model"
|
||||
type:
|
||||
type: string
|
||||
description: "Type of the model (checkpoint, lora, embedding, etc.)"
|
||||
url:
|
||||
type: string
|
||||
description: "Download URL for the model"
|
||||
description:
|
||||
type: string
|
||||
description: "Description of the model"
|
||||
size:
|
||||
type: integer
|
||||
description: "Size of the model in bytes"
|
||||
installed:
|
||||
type: boolean
|
||||
description: "Whether the model is installed"
|
||||
version:
|
||||
type: string
|
||||
description: "Version of the model"
|
||||
tags:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: "Tags associated with the model"
|
||||
|
||||
Snapshot:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- date
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: "Name of the snapshot"
|
||||
date:
|
||||
type: string
|
||||
format: date-time
|
||||
description: "Date when the snapshot was created"
|
||||
description:
|
||||
type: string
|
||||
description: "Description of the snapshot"
|
||||
nodes:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: "List of custom nodes in the snapshot"
|
||||
models:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: "List of models in the snapshot"
|
||||
|
||||
QueueStatus:
|
||||
type: object
|
||||
properties:
|
||||
pending:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/QueueItem'
|
||||
description: "List of pending operations in the queue"
|
||||
completed:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/QueueItem'
|
||||
description: "List of completed operations in the queue"
|
||||
failed:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/QueueItem'
|
||||
description: "List of failed operations in the queue"
|
||||
running:
|
||||
type: boolean
|
||||
description: "Whether the queue is currently running"
|
||||
|
||||
QueueItem:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- type
|
||||
- target
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: "Unique ID of the queue item"
|
||||
type:
|
||||
type: string
|
||||
enum: [install, update, uninstall]
|
||||
description: "Type of operation"
|
||||
target:
|
||||
type: string
|
||||
description: "Target of the operation (e.g., custom node name, model name)"
|
||||
status:
|
||||
type: string
|
||||
enum: [pending, processing, completed, failed]
|
||||
description: "Current status of the operation"
|
||||
error:
|
||||
type: string
|
||||
description: "Error message if the operation failed"
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
description: "Time when the operation was added to the queue"
|
||||
completed_at:
|
||||
type: string
|
||||
format: date-time
|
||||
description: "Time when the operation was completed"
|
||||
|
||||
securitySchemes:
|
||||
ApiKeyAuth:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: X-API-Key
|
||||
description: "API key for authentication"
|
||||
6
tests-api/requirements-test.txt
Normal file
6
tests-api/requirements-test.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
pytest>=7.3.1
|
||||
requests>=2.31.0
|
||||
openapi-spec-validator>=0.6.0
|
||||
jsonschema>=4.17.3
|
||||
pytest-asyncio>=0.21.0
|
||||
pyyaml>=6.0
|
||||
270
tests-api/test_config_api.py
Normal file
270
tests-api/test_config_api.py
Normal file
@@ -0,0 +1,270 @@
|
||||
"""
|
||||
Tests for configuration endpoints.
|
||||
"""
|
||||
import pytest
|
||||
from typing import Callable, Dict, List, Tuple
|
||||
|
||||
from utils.validation import validate_response
|
||||
|
||||
|
||||
def test_get_preview_method(
|
||||
api_request: Callable
|
||||
):
|
||||
"""
|
||||
Test getting the current preview method.
|
||||
"""
|
||||
# Make the API request
|
||||
path = "/manager/preview_method"
|
||||
response, _ = api_request(
|
||||
method="get",
|
||||
path=path,
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Verify the response is one of the valid preview methods
|
||||
assert response.text in ["auto", "latent2rgb", "taesd", "none"]
|
||||
|
||||
|
||||
def test_get_db_mode(
|
||||
api_request: Callable
|
||||
):
|
||||
"""
|
||||
Test getting the current database mode.
|
||||
"""
|
||||
# Make the API request
|
||||
path = "/manager/db_mode"
|
||||
response, _ = api_request(
|
||||
method="get",
|
||||
path=path,
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Verify the response is one of the valid database modes
|
||||
assert response.text in ["channel", "local", "remote"]
|
||||
|
||||
|
||||
def test_get_component_policy(
|
||||
api_request: Callable
|
||||
):
|
||||
"""
|
||||
Test getting the current component policy.
|
||||
"""
|
||||
# Make the API request
|
||||
path = "/manager/policy/component"
|
||||
response, _ = api_request(
|
||||
method="get",
|
||||
path=path,
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Component policy could be any string
|
||||
assert response.text is not None
|
||||
|
||||
|
||||
def test_get_update_policy(
|
||||
api_request: Callable
|
||||
):
|
||||
"""
|
||||
Test getting the current update policy.
|
||||
"""
|
||||
# Make the API request
|
||||
path = "/manager/policy/update"
|
||||
response, _ = api_request(
|
||||
method="get",
|
||||
path=path,
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Verify the response is one of the valid update policies
|
||||
assert response.text in ["stable", "nightly", "nightly-comfyui"]
|
||||
|
||||
|
||||
def test_get_channel_url_list(
|
||||
api_request: Callable,
|
||||
openapi_spec: Dict
|
||||
):
|
||||
"""
|
||||
Test getting the channel URL list.
|
||||
"""
|
||||
# Make the API request
|
||||
path = "/manager/channel_url_list"
|
||||
response, json_data = api_request(
|
||||
method="get",
|
||||
path=path,
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Validate response structure against the schema
|
||||
assert json_data is not None
|
||||
validate_response(
|
||||
response_data=json_data,
|
||||
path=path,
|
||||
method="get",
|
||||
spec=openapi_spec,
|
||||
)
|
||||
|
||||
# Verify the response contains the expected fields
|
||||
assert "selected" in json_data
|
||||
assert "list" in json_data
|
||||
assert isinstance(json_data["list"], list)
|
||||
|
||||
# Each channel should have a name and URL
|
||||
if json_data["list"]:
|
||||
first_channel = json_data["list"][0]
|
||||
assert "name" in first_channel
|
||||
assert "url" in first_channel
|
||||
|
||||
|
||||
def test_get_manager_version(
|
||||
api_request: Callable
|
||||
):
|
||||
"""
|
||||
Test getting the manager version.
|
||||
"""
|
||||
# Make the API request
|
||||
path = "/manager/version"
|
||||
response, _ = api_request(
|
||||
method="get",
|
||||
path=path,
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Verify the response is a version string
|
||||
assert response.text.startswith("V") # Version strings start with V
|
||||
|
||||
|
||||
def test_get_manager_notice(
|
||||
api_request: Callable
|
||||
):
|
||||
"""
|
||||
Test getting the manager notice.
|
||||
"""
|
||||
# Make the API request
|
||||
path = "/manager/notice"
|
||||
response, _ = api_request(
|
||||
method="get",
|
||||
path=path,
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Verify the response is HTML content
|
||||
assert response.headers.get("Content-Type", "").startswith("text/html") or "ComfyUI" in response.text
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="State-modifying operations")
|
||||
class TestConfigChanges:
|
||||
"""
|
||||
Tests for changing configuration settings.
|
||||
These are skipped to avoid modifying state in automated tests.
|
||||
"""
|
||||
|
||||
@pytest.fixture(scope="class", autouse=True)
|
||||
def save_original_config(self, api_request: Callable):
|
||||
"""
|
||||
Save the original configuration to restore after tests.
|
||||
"""
|
||||
# Save original values
|
||||
response, _ = api_request(
|
||||
method="get",
|
||||
path="/manager/preview_method",
|
||||
expected_status=200,
|
||||
)
|
||||
self.original_preview_method = response.text
|
||||
|
||||
response, _ = api_request(
|
||||
method="get",
|
||||
path="/manager/db_mode",
|
||||
expected_status=200,
|
||||
)
|
||||
self.original_db_mode = response.text
|
||||
|
||||
response, _ = api_request(
|
||||
method="get",
|
||||
path="/manager/policy/update",
|
||||
expected_status=200,
|
||||
)
|
||||
self.original_update_policy = response.text
|
||||
|
||||
yield
|
||||
|
||||
# Restore original values
|
||||
api_request(
|
||||
method="get",
|
||||
path="/manager/preview_method",
|
||||
params={"value": self.original_preview_method},
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
api_request(
|
||||
method="get",
|
||||
path="/manager/db_mode",
|
||||
params={"value": self.original_db_mode},
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
api_request(
|
||||
method="get",
|
||||
path="/manager/policy/update",
|
||||
params={"value": self.original_update_policy},
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
def test_set_preview_method(self, api_request: Callable):
|
||||
"""
|
||||
Test setting the preview method.
|
||||
"""
|
||||
# Set to a different value (taesd)
|
||||
api_request(
|
||||
method="get",
|
||||
path="/manager/preview_method",
|
||||
params={"value": "taesd"},
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Verify it was changed
|
||||
response, _ = api_request(
|
||||
method="get",
|
||||
path="/manager/preview_method",
|
||||
expected_status=200,
|
||||
)
|
||||
assert response.text == "taesd"
|
||||
|
||||
def test_set_db_mode(self, api_request: Callable):
|
||||
"""
|
||||
Test setting the database mode.
|
||||
"""
|
||||
# Set to local mode
|
||||
api_request(
|
||||
method="get",
|
||||
path="/manager/db_mode",
|
||||
params={"value": "local"},
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Verify it was changed
|
||||
response, _ = api_request(
|
||||
method="get",
|
||||
path="/manager/db_mode",
|
||||
expected_status=200,
|
||||
)
|
||||
assert response.text == "local"
|
||||
|
||||
def test_set_update_policy(self, api_request: Callable):
|
||||
"""
|
||||
Test setting the update policy.
|
||||
"""
|
||||
# Set to stable
|
||||
api_request(
|
||||
method="get",
|
||||
path="/manager/policy/update",
|
||||
params={"value": "stable"},
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Verify it was changed
|
||||
response, _ = api_request(
|
||||
method="get",
|
||||
path="/manager/policy/update",
|
||||
expected_status=200,
|
||||
)
|
||||
assert response.text == "stable"
|
||||
200
tests-api/test_customnode_api.py
Normal file
200
tests-api/test_customnode_api.py
Normal file
@@ -0,0 +1,200 @@
|
||||
"""
|
||||
Tests for custom node management endpoints.
|
||||
"""
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
from typing import Callable, Dict, Tuple
|
||||
|
||||
from utils.validation import validate_response
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"mode",
|
||||
["local", "remote"]
|
||||
)
|
||||
def test_get_custom_node_list(
|
||||
api_request: Callable,
|
||||
openapi_spec: Dict,
|
||||
mode: str
|
||||
):
|
||||
"""
|
||||
Test the endpoint for listing custom nodes.
|
||||
"""
|
||||
# Make the API request
|
||||
path = "/customnode/getlist"
|
||||
response, json_data = api_request(
|
||||
method="get",
|
||||
path=path,
|
||||
params={"mode": mode, "skip_update": "true"},
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Validate response structure against the schema
|
||||
assert json_data is not None
|
||||
validate_response(
|
||||
response_data=json_data,
|
||||
path=path,
|
||||
method="get",
|
||||
spec=openapi_spec,
|
||||
)
|
||||
|
||||
# Verify the response contains the expected fields
|
||||
assert "channel" in json_data
|
||||
assert "node_packs" in json_data
|
||||
assert isinstance(json_data["node_packs"], dict)
|
||||
|
||||
# If there are any node packs, verify they have the expected structure
|
||||
if json_data["node_packs"]:
|
||||
# Take the first node pack to validate
|
||||
first_node_pack = next(iter(json_data["node_packs"].values()))
|
||||
assert "title" in first_node_pack
|
||||
assert "name" in first_node_pack
|
||||
|
||||
|
||||
def test_get_installed_nodes(
|
||||
api_request: Callable,
|
||||
openapi_spec: Dict
|
||||
):
|
||||
"""
|
||||
Test the endpoint for listing installed nodes.
|
||||
"""
|
||||
# Make the API request
|
||||
path = "/customnode/installed"
|
||||
response, json_data = api_request(
|
||||
method="get",
|
||||
path=path,
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Validate response structure against the schema
|
||||
assert json_data is not None
|
||||
validate_response(
|
||||
response_data=json_data,
|
||||
path=path,
|
||||
method="get",
|
||||
spec=openapi_spec,
|
||||
)
|
||||
|
||||
# Verify the response is a dictionary of node packs
|
||||
assert isinstance(json_data, dict)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"mode",
|
||||
["local", "nickname"]
|
||||
)
|
||||
def test_get_node_mappings(
|
||||
api_request: Callable,
|
||||
openapi_spec: Dict,
|
||||
mode: str
|
||||
):
|
||||
"""
|
||||
Test the endpoint for getting node-to-package mappings.
|
||||
"""
|
||||
# Make the API request
|
||||
path = "/customnode/getmappings"
|
||||
response, json_data = api_request(
|
||||
method="get",
|
||||
path=path,
|
||||
params={"mode": mode},
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Validate response structure against the schema
|
||||
assert json_data is not None
|
||||
validate_response(
|
||||
response_data=json_data,
|
||||
path=path,
|
||||
method="get",
|
||||
spec=openapi_spec,
|
||||
)
|
||||
|
||||
# Verify the response is a dictionary mapping extension IDs to node info
|
||||
assert isinstance(json_data, dict)
|
||||
|
||||
# If there are any mappings, verify they have the expected structure
|
||||
if json_data:
|
||||
# Take the first mapping to validate
|
||||
first_mapping = next(iter(json_data.values()))
|
||||
assert isinstance(first_mapping, list)
|
||||
assert len(first_mapping) == 2
|
||||
assert isinstance(first_mapping[0], list) # List of node classes
|
||||
assert isinstance(first_mapping[1], dict) # Metadata
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"mode",
|
||||
["local", "remote"]
|
||||
)
|
||||
def test_get_node_alternatives(
|
||||
api_request: Callable,
|
||||
openapi_spec: Dict,
|
||||
mode: str
|
||||
):
|
||||
"""
|
||||
Test the endpoint for getting alternative node options.
|
||||
"""
|
||||
# Make the API request
|
||||
path = "/customnode/alternatives"
|
||||
response, json_data = api_request(
|
||||
method="get",
|
||||
path=path,
|
||||
params={"mode": mode},
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Validate response structure against the schema
|
||||
assert json_data is not None
|
||||
validate_response(
|
||||
response_data=json_data,
|
||||
path=path,
|
||||
method="get",
|
||||
spec=openapi_spec,
|
||||
)
|
||||
|
||||
# Verify the response is a dictionary
|
||||
assert isinstance(json_data, dict)
|
||||
|
||||
|
||||
def test_fetch_updates(
|
||||
api_request: Callable
|
||||
):
|
||||
"""
|
||||
Test the endpoint for fetching updates.
|
||||
This might modify state, so we just check for a valid response.
|
||||
"""
|
||||
# Make the API request with skip_update=true to avoid actual updates
|
||||
path = "/customnode/fetch_updates"
|
||||
response, _ = api_request(
|
||||
method="get",
|
||||
path=path,
|
||||
params={"mode": "local"},
|
||||
# Don't validate JSON since this endpoint doesn't return JSON
|
||||
expected_status=200,
|
||||
retry_on_error=False, # Don't retry as this might have side effects
|
||||
)
|
||||
|
||||
# Just check the status code is as expected (covered by api_request)
|
||||
assert response.status_code in [200, 201]
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Queue endpoints are better tested with queue operations")
|
||||
def test_queue_update_all(
|
||||
api_request: Callable
|
||||
):
|
||||
"""
|
||||
Test the endpoint for queuing updates for all nodes.
|
||||
Skipping as this would actually modify the installation.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Security-restricted endpoint")
|
||||
def test_install_node_via_git_url(
|
||||
api_request: Callable
|
||||
):
|
||||
"""
|
||||
Test the endpoint for installing a node via Git URL.
|
||||
Skipping as this requires high security level and would modify the installation.
|
||||
"""
|
||||
pass
|
||||
23
tests-api/test_import.py
Normal file
23
tests-api/test_import.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Print current working directory
|
||||
print(f"Current directory: {os.getcwd()}")
|
||||
|
||||
# Print module search path
|
||||
print(f"System path: {sys.path}")
|
||||
|
||||
# Try to import
|
||||
try:
|
||||
from utils.validation import load_openapi_spec
|
||||
print("Import successful!")
|
||||
except ImportError as e:
|
||||
print(f"Import error: {e}")
|
||||
|
||||
# Try direct import
|
||||
try:
|
||||
sys.path.insert(0, os.path.join(os.getcwd(), "custom_nodes/ComfyUI-Manager/tests-api"))
|
||||
from utils.validation import load_openapi_spec
|
||||
print("Direct import successful!")
|
||||
except ImportError as e:
|
||||
print(f"Direct import error: {e}")
|
||||
62
tests-api/test_model_api.py
Normal file
62
tests-api/test_model_api.py
Normal file
@@ -0,0 +1,62 @@
|
||||
"""
|
||||
Tests for model management endpoints.
|
||||
These features are scheduled for deprecation, so tests are minimal.
|
||||
"""
|
||||
import pytest
|
||||
from typing import Callable, Dict
|
||||
|
||||
from utils.validation import validate_response
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"mode",
|
||||
["local", "remote"]
|
||||
)
|
||||
def test_get_external_model_list(
|
||||
api_request: Callable,
|
||||
openapi_spec: Dict,
|
||||
mode: str
|
||||
):
|
||||
"""
|
||||
Test the endpoint for listing external models.
|
||||
"""
|
||||
# Make the API request
|
||||
path = "/externalmodel/getlist"
|
||||
response, json_data = api_request(
|
||||
method="get",
|
||||
path=path,
|
||||
params={"mode": mode},
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Validate response structure against the schema
|
||||
assert json_data is not None
|
||||
validate_response(
|
||||
response_data=json_data,
|
||||
path=path,
|
||||
method="get",
|
||||
spec=openapi_spec,
|
||||
)
|
||||
|
||||
# Verify the response contains the expected fields
|
||||
assert "models" in json_data
|
||||
assert isinstance(json_data["models"], list)
|
||||
|
||||
# If there are any models, verify they have the expected structure
|
||||
if json_data["models"]:
|
||||
first_model = json_data["models"][0]
|
||||
assert "name" in first_model
|
||||
assert "type" in first_model
|
||||
assert "url" in first_model
|
||||
assert "filename" in first_model
|
||||
assert "installed" in first_model
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="State-modifying operation that requires auth")
|
||||
def test_install_model():
|
||||
"""
|
||||
Test queuing a model installation.
|
||||
Skipped to avoid modifying state and requires authentication.
|
||||
This feature is also scheduled for deprecation.
|
||||
"""
|
||||
pass
|
||||
213
tests-api/test_queue_api.py
Normal file
213
tests-api/test_queue_api.py
Normal file
@@ -0,0 +1,213 @@
|
||||
"""
|
||||
Tests for queue management endpoints.
|
||||
"""
|
||||
import pytest
|
||||
import time
|
||||
from pathlib import Path
|
||||
from typing import Callable, Dict, Tuple
|
||||
|
||||
from utils.validation import validate_response
|
||||
|
||||
|
||||
def test_get_queue_status(
|
||||
api_request: Callable,
|
||||
openapi_spec: Dict
|
||||
):
|
||||
"""
|
||||
Test the endpoint for getting queue status.
|
||||
"""
|
||||
# Make the API request
|
||||
path = "/manager/queue/status"
|
||||
response, json_data = api_request(
|
||||
method="get",
|
||||
path=path,
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Validate response structure against the schema
|
||||
assert json_data is not None
|
||||
validate_response(
|
||||
response_data=json_data,
|
||||
path=path,
|
||||
method="get",
|
||||
spec=openapi_spec,
|
||||
)
|
||||
|
||||
# Verify the response contains the expected fields
|
||||
assert "total_count" in json_data
|
||||
assert "done_count" in json_data
|
||||
assert "in_progress_count" in json_data
|
||||
assert "is_processing" in json_data
|
||||
|
||||
# Type checks
|
||||
assert isinstance(json_data["total_count"], int)
|
||||
assert isinstance(json_data["done_count"], int)
|
||||
assert isinstance(json_data["in_progress_count"], int)
|
||||
assert isinstance(json_data["is_processing"], bool)
|
||||
|
||||
|
||||
def test_reset_queue(
|
||||
api_request: Callable
|
||||
):
|
||||
"""
|
||||
Test the endpoint for resetting the queue.
|
||||
"""
|
||||
# Make the API request
|
||||
path = "/manager/queue/reset"
|
||||
response, _ = api_request(
|
||||
method="get",
|
||||
path=path,
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Now check the queue status to verify it was reset
|
||||
response2, json_data = api_request(
|
||||
method="get",
|
||||
path="/manager/queue/status",
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Queue should be empty after reset
|
||||
assert json_data["total_count"] == json_data["done_count"] + json_data["in_progress_count"]
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="State-modifying operation that requires auth")
|
||||
def test_queue_install_node():
|
||||
"""
|
||||
Test queuing a node installation.
|
||||
Skipped to avoid modifying state and requires authentication.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="State-modifying operation that requires auth")
|
||||
def test_queue_update_node():
|
||||
"""
|
||||
Test queuing a node update.
|
||||
Skipped to avoid modifying state and requires authentication.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="State-modifying operation that requires auth")
|
||||
def test_queue_uninstall_node():
|
||||
"""
|
||||
Test queuing a node uninstallation.
|
||||
Skipped to avoid modifying state and requires authentication.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="State-modifying operation")
|
||||
def test_queue_start():
|
||||
"""
|
||||
Test starting the queue.
|
||||
Skipped to avoid modifying state.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class TestQueueOperations:
|
||||
"""
|
||||
Test a complete queue workflow.
|
||||
These tests are grouped to ensure proper sequencing but are still skipped
|
||||
to avoid modifying state in automated tests.
|
||||
"""
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def node_data(self) -> Dict:
|
||||
"""
|
||||
Create test data for a node operation.
|
||||
"""
|
||||
# This would be replaced with actual data for a known safe node
|
||||
return {
|
||||
"ui_id": "test_node_1",
|
||||
"id": "comfyui-manager", # Manager itself
|
||||
"version": "latest",
|
||||
"channel": "default",
|
||||
"mode": "local",
|
||||
}
|
||||
|
||||
@pytest.mark.skip(reason="State-modifying operation")
|
||||
def test_queue_operation_sequence(
|
||||
self,
|
||||
api_request: Callable,
|
||||
node_data: Dict
|
||||
):
|
||||
"""
|
||||
Test the queue operation sequence.
|
||||
"""
|
||||
# 1. Reset the queue
|
||||
api_request(
|
||||
method="get",
|
||||
path="/manager/queue/reset",
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# 2. Queue a node operation (we'll use the manager itself)
|
||||
api_request(
|
||||
method="post",
|
||||
path="/manager/queue/update",
|
||||
json_data=node_data,
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# 3. Check queue status - should have one operation
|
||||
response, json_data = api_request(
|
||||
method="get",
|
||||
path="/manager/queue/status",
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
assert json_data["total_count"] > 0
|
||||
assert not json_data["is_processing"] # Queue hasn't started yet
|
||||
|
||||
# 4. Start the queue
|
||||
api_request(
|
||||
method="get",
|
||||
path="/manager/queue/start",
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# 5. Check queue status again - should be processing
|
||||
response, json_data = api_request(
|
||||
method="get",
|
||||
path="/manager/queue/status",
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Queue should be processing or already done
|
||||
assert json_data["is_processing"] or json_data["done_count"] == json_data["total_count"]
|
||||
|
||||
# 6. Wait for queue to complete (with timeout)
|
||||
max_wait_time = 60 # seconds
|
||||
start_time = time.time()
|
||||
completed = False
|
||||
|
||||
while time.time() - start_time < max_wait_time:
|
||||
response, json_data = api_request(
|
||||
method="get",
|
||||
path="/manager/queue/status",
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
if json_data["done_count"] == json_data["total_count"] and not json_data["is_processing"]:
|
||||
completed = True
|
||||
break
|
||||
|
||||
time.sleep(2) # Wait before checking again
|
||||
|
||||
assert completed, "Queue did not complete within timeout period"
|
||||
|
||||
@pytest.mark.skip(reason="State-modifying operation")
|
||||
def test_concurrent_queue_operations(
|
||||
self,
|
||||
api_request: Callable,
|
||||
node_data: Dict
|
||||
):
|
||||
"""
|
||||
Test concurrent queue operations.
|
||||
"""
|
||||
# This would test adding multiple operations to the queue
|
||||
# and verifying they all complete correctly
|
||||
pass
|
||||
198
tests-api/test_snapshot_api.py
Normal file
198
tests-api/test_snapshot_api.py
Normal file
@@ -0,0 +1,198 @@
|
||||
"""
|
||||
Tests for snapshot management endpoints.
|
||||
"""
|
||||
import pytest
|
||||
import time
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import Callable, Dict, List, Optional
|
||||
|
||||
from utils.validation import validate_response
|
||||
|
||||
|
||||
def test_get_snapshot_list(
|
||||
api_request: Callable,
|
||||
openapi_spec: Dict
|
||||
):
|
||||
"""
|
||||
Test the endpoint for listing snapshots.
|
||||
"""
|
||||
# Make the API request
|
||||
path = "/snapshot/getlist"
|
||||
response, json_data = api_request(
|
||||
method="get",
|
||||
path=path,
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Validate response structure against the schema
|
||||
assert json_data is not None
|
||||
validate_response(
|
||||
response_data=json_data,
|
||||
path=path,
|
||||
method="get",
|
||||
spec=openapi_spec,
|
||||
)
|
||||
|
||||
# Verify the response contains the expected fields
|
||||
assert "items" in json_data
|
||||
assert isinstance(json_data["items"], list)
|
||||
|
||||
|
||||
def test_get_current_snapshot(
|
||||
api_request: Callable,
|
||||
openapi_spec: Dict
|
||||
):
|
||||
"""
|
||||
Test the endpoint for getting the current snapshot.
|
||||
"""
|
||||
# Make the API request
|
||||
path = "/snapshot/get_current"
|
||||
response, json_data = api_request(
|
||||
method="get",
|
||||
path=path,
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Validate response structure against the schema
|
||||
assert json_data is not None
|
||||
validate_response(
|
||||
response_data=json_data,
|
||||
path=path,
|
||||
method="get",
|
||||
spec=openapi_spec,
|
||||
)
|
||||
|
||||
# Check for basic snapshot structure
|
||||
assert "snapshot_date" in json_data
|
||||
assert "custom_nodes" in json_data
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="This test creates a snapshot which is a state-modifying operation")
|
||||
def test_save_snapshot(
|
||||
api_request: Callable
|
||||
):
|
||||
"""
|
||||
Test the endpoint for saving a new snapshot.
|
||||
Skipped to avoid modifying state in tests.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="This test removes a snapshot which is a destructive operation")
|
||||
def test_remove_snapshot(
|
||||
api_request: Callable
|
||||
):
|
||||
"""
|
||||
Test the endpoint for removing a snapshot.
|
||||
Skipped to avoid modifying state in tests.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="This test restores a snapshot which is a state-modifying operation")
|
||||
def test_restore_snapshot(
|
||||
api_request: Callable
|
||||
):
|
||||
"""
|
||||
Test the endpoint for restoring a snapshot.
|
||||
Skipped to avoid modifying state in tests.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class TestSnapshotWorkflow:
|
||||
"""
|
||||
Test the complete snapshot workflow (create, list, get, remove).
|
||||
These tests are grouped to ensure proper sequencing but are still skipped
|
||||
to avoid modifying state in automated tests.
|
||||
"""
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def snapshot_name(self) -> str:
|
||||
"""
|
||||
Generate a unique snapshot name for testing.
|
||||
"""
|
||||
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||
return f"test_snapshot_{timestamp}"
|
||||
|
||||
@pytest.mark.skip(reason="State-modifying test")
|
||||
def test_create_snapshot(
|
||||
self,
|
||||
api_request: Callable,
|
||||
snapshot_name: str
|
||||
):
|
||||
"""
|
||||
Test creating a snapshot.
|
||||
"""
|
||||
# Make the API request to save a snapshot
|
||||
response, _ = api_request(
|
||||
method="get",
|
||||
path="/snapshot/save",
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Verify a snapshot was created (would need to check the snapshot list)
|
||||
response2, json_data = api_request(
|
||||
method="get",
|
||||
path="/snapshot/getlist",
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# The most recently created snapshot should be first in the list
|
||||
assert json_data["items"]
|
||||
|
||||
# Store the snapshot name for later tests
|
||||
self.actual_snapshot_name = json_data["items"][0]
|
||||
|
||||
@pytest.mark.skip(reason="State-modifying test")
|
||||
def test_get_snapshot_details(
|
||||
self,
|
||||
api_request: Callable,
|
||||
openapi_spec: Dict
|
||||
):
|
||||
"""
|
||||
Test getting details of the created snapshot.
|
||||
"""
|
||||
# This would check the current snapshot, not a specific one
|
||||
# since there's no direct API to get a specific snapshot
|
||||
response, json_data = api_request(
|
||||
method="get",
|
||||
path="/snapshot/get_current",
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Validate the snapshot data
|
||||
assert json_data is not None
|
||||
validate_response(
|
||||
response_data=json_data,
|
||||
path="/snapshot/get_current",
|
||||
method="get",
|
||||
spec=openapi_spec,
|
||||
)
|
||||
|
||||
@pytest.mark.skip(reason="State-modifying test")
|
||||
def test_remove_test_snapshot(
|
||||
self,
|
||||
api_request: Callable
|
||||
):
|
||||
"""
|
||||
Test removing the test snapshot.
|
||||
"""
|
||||
# Make the API request to remove the snapshot
|
||||
response, _ = api_request(
|
||||
method="get",
|
||||
path="/snapshot/remove",
|
||||
params={"target": self.actual_snapshot_name},
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# Verify the snapshot was removed
|
||||
response2, json_data = api_request(
|
||||
method="get",
|
||||
path="/snapshot/getlist",
|
||||
expected_status=200,
|
||||
)
|
||||
|
||||
# The snapshot should no longer be in the list
|
||||
assert self.actual_snapshot_name not in json_data["items"]
|
||||
150
tests-api/test_spec_validation.py
Normal file
150
tests-api/test_spec_validation.py
Normal file
@@ -0,0 +1,150 @@
|
||||
"""
|
||||
Tests for validating the OpenAPI specification.
|
||||
"""
|
||||
import json
|
||||
import pytest
|
||||
import yaml
|
||||
from typing import Dict, Any, List, Tuple
|
||||
from pathlib import Path
|
||||
from openapi_spec_validator import validate_spec
|
||||
from utils.validation import load_openapi_spec
|
||||
from utils.schema_utils import (
|
||||
get_all_paths,
|
||||
get_methods_for_path,
|
||||
find_paths_with_security,
|
||||
get_required_parameters
|
||||
)
|
||||
|
||||
|
||||
def test_spec_is_valid():
|
||||
"""
|
||||
Test that the OpenAPI specification is valid according to the spec validator.
|
||||
"""
|
||||
spec = load_openapi_spec()
|
||||
validate_spec(spec)
|
||||
|
||||
|
||||
def test_spec_has_info():
|
||||
"""
|
||||
Test that the OpenAPI specification has basic info.
|
||||
"""
|
||||
spec = load_openapi_spec()
|
||||
|
||||
assert "info" in spec
|
||||
assert "title" in spec["info"]
|
||||
assert "version" in spec["info"]
|
||||
assert spec["info"]["title"] == "ComfyUI-Manager API"
|
||||
|
||||
|
||||
def test_spec_has_paths():
|
||||
"""
|
||||
Test that the OpenAPI specification has paths defined.
|
||||
"""
|
||||
spec = load_openapi_spec()
|
||||
|
||||
assert "paths" in spec
|
||||
assert len(spec["paths"]) > 0
|
||||
|
||||
|
||||
def test_paths_have_responses():
|
||||
"""
|
||||
Test that all paths have responses defined.
|
||||
"""
|
||||
spec = load_openapi_spec()
|
||||
|
||||
for path, path_item in spec["paths"].items():
|
||||
for method, operation in path_item.items():
|
||||
if method.lower() not in {"get", "post", "put", "delete", "patch", "options", "head"}:
|
||||
continue
|
||||
|
||||
assert "responses" in operation, f"Path {path} method {method} has no responses"
|
||||
assert len(operation["responses"]) > 0, f"Path {path} method {method} has empty responses"
|
||||
|
||||
|
||||
def test_responses_have_schemas():
|
||||
"""
|
||||
Test that responses with application/json content type have schemas.
|
||||
"""
|
||||
spec = load_openapi_spec()
|
||||
|
||||
for path, path_item in spec["paths"].items():
|
||||
for method, operation in path_item.items():
|
||||
if method.lower() not in {"get", "post", "put", "delete", "patch", "options", "head"}:
|
||||
continue
|
||||
|
||||
for status, response in operation["responses"].items():
|
||||
if "content" not in response:
|
||||
continue
|
||||
|
||||
if "application/json" in response["content"]:
|
||||
assert "schema" in response["content"]["application/json"], (
|
||||
f"Path {path} method {method} status {status} "
|
||||
f"application/json content has no schema"
|
||||
)
|
||||
|
||||
|
||||
def test_required_parameters_have_schemas():
|
||||
"""
|
||||
Test that all required parameters have schemas.
|
||||
"""
|
||||
spec = load_openapi_spec()
|
||||
|
||||
for path, path_item in spec["paths"].items():
|
||||
for method, operation in path_item.items():
|
||||
if method.lower() not in {"get", "post", "put", "delete", "patch", "options", "head"}:
|
||||
continue
|
||||
|
||||
if "parameters" not in operation:
|
||||
continue
|
||||
|
||||
for param in operation["parameters"]:
|
||||
if param.get("required", False):
|
||||
assert "schema" in param, (
|
||||
f"Path {path} method {method} required parameter {param.get('name')} has no schema"
|
||||
)
|
||||
|
||||
|
||||
def test_security_schemes_defined():
|
||||
"""
|
||||
Test that security schemes are properly defined.
|
||||
"""
|
||||
spec = load_openapi_spec()
|
||||
|
||||
# Get paths requiring security
|
||||
secure_paths = find_paths_with_security(spec)
|
||||
|
||||
if secure_paths:
|
||||
assert "components" in spec, "Spec has secure paths but no components"
|
||||
assert "securitySchemes" in spec["components"], "Spec has secure paths but no securitySchemes"
|
||||
|
||||
# Check each security reference is defined
|
||||
for path, method in secure_paths:
|
||||
operation = spec["paths"][path][method]
|
||||
for security_req in operation["security"]:
|
||||
for scheme_name in security_req:
|
||||
assert scheme_name in spec["components"]["securitySchemes"], (
|
||||
f"Security scheme {scheme_name} used by {method.upper()} {path} "
|
||||
f"is not defined in components.securitySchemes"
|
||||
)
|
||||
|
||||
|
||||
def test_common_endpoint_groups_present():
|
||||
"""
|
||||
Test that the spec includes the main endpoint groups.
|
||||
"""
|
||||
spec = load_openapi_spec()
|
||||
paths = get_all_paths(spec)
|
||||
|
||||
# Define the expected endpoint prefixes
|
||||
expected_prefixes = [
|
||||
"/customnode/",
|
||||
"/externalmodel/",
|
||||
"/manager/",
|
||||
"/snapshot/",
|
||||
"/comfyui_manager/",
|
||||
]
|
||||
|
||||
# Check that at least one path exists for each expected prefix
|
||||
for prefix in expected_prefixes:
|
||||
matching_paths = [p for p in paths if p.startswith(prefix)]
|
||||
assert matching_paths, f"No endpoints found with prefix {prefix}"
|
||||
1
tests-api/utils/__init__.py
Normal file
1
tests-api/utils/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# Make utils directory a proper package
|
||||
174
tests-api/utils/schema_utils.py
Normal file
174
tests-api/utils/schema_utils.py
Normal file
@@ -0,0 +1,174 @@
|
||||
"""
|
||||
Schema utilities for extracting and manipulating OpenAPI schemas.
|
||||
"""
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Optional, Set, Tuple
|
||||
from .validation import load_openapi_spec
|
||||
|
||||
|
||||
def get_all_paths(spec: Dict[str, Any]) -> List[str]:
|
||||
"""
|
||||
Get all paths defined in the OpenAPI specification.
|
||||
|
||||
Args:
|
||||
spec: The OpenAPI specification
|
||||
|
||||
Returns:
|
||||
List of all paths
|
||||
"""
|
||||
return list(spec.get("paths", {}).keys())
|
||||
|
||||
|
||||
def get_grouped_paths(spec: Dict[str, Any]) -> Dict[str, List[str]]:
|
||||
"""
|
||||
Group paths by their top-level segment.
|
||||
|
||||
Args:
|
||||
spec: The OpenAPI specification
|
||||
|
||||
Returns:
|
||||
Dictionary mapping top-level segments to lists of paths
|
||||
"""
|
||||
result = {}
|
||||
|
||||
for path in get_all_paths(spec):
|
||||
segments = path.strip("/").split("/")
|
||||
if not segments:
|
||||
continue
|
||||
|
||||
top_segment = segments[0]
|
||||
if top_segment not in result:
|
||||
result[top_segment] = []
|
||||
|
||||
result[top_segment].append(path)
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def get_methods_for_path(spec: Dict[str, Any], path: str) -> List[str]:
|
||||
"""
|
||||
Get all HTTP methods defined for a path.
|
||||
|
||||
Args:
|
||||
spec: The OpenAPI specification
|
||||
path: The API path
|
||||
|
||||
Returns:
|
||||
List of HTTP methods (lowercase)
|
||||
"""
|
||||
if path not in spec.get("paths", {}):
|
||||
return []
|
||||
|
||||
return [
|
||||
method.lower()
|
||||
for method in spec["paths"][path].keys()
|
||||
if method.lower() in {"get", "post", "put", "delete", "patch", "options", "head"}
|
||||
]
|
||||
|
||||
|
||||
def find_paths_with_security(
|
||||
spec: Dict[str, Any],
|
||||
security_scheme: Optional[str] = None
|
||||
) -> List[Tuple[str, str]]:
|
||||
"""
|
||||
Find all paths that require security.
|
||||
|
||||
Args:
|
||||
spec: The OpenAPI specification
|
||||
security_scheme: Optional specific security scheme to filter by
|
||||
|
||||
Returns:
|
||||
List of (path, method) tuples that require security
|
||||
"""
|
||||
result = []
|
||||
|
||||
for path, path_item in spec.get("paths", {}).items():
|
||||
for method, operation in path_item.items():
|
||||
if method.lower() not in {"get", "post", "put", "delete", "patch", "options", "head"}:
|
||||
continue
|
||||
|
||||
if "security" in operation:
|
||||
if security_scheme is None:
|
||||
result.append((path, method.lower()))
|
||||
else:
|
||||
# Check if this security scheme is required
|
||||
for security_req in operation["security"]:
|
||||
if security_scheme in security_req:
|
||||
result.append((path, method.lower()))
|
||||
break
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def get_content_types_for_response(
|
||||
spec: Dict[str, Any],
|
||||
path: str,
|
||||
method: str,
|
||||
status_code: str = "200"
|
||||
) -> List[str]:
|
||||
"""
|
||||
Get content types defined for a response.
|
||||
|
||||
Args:
|
||||
spec: The OpenAPI specification
|
||||
path: The API path
|
||||
method: The HTTP method
|
||||
status_code: The HTTP status code
|
||||
|
||||
Returns:
|
||||
List of content types
|
||||
"""
|
||||
method = method.lower()
|
||||
|
||||
if path not in spec["paths"]:
|
||||
return []
|
||||
|
||||
if method not in spec["paths"][path]:
|
||||
return []
|
||||
|
||||
if "responses" not in spec["paths"][path][method]:
|
||||
return []
|
||||
|
||||
if status_code not in spec["paths"][path][method]["responses"]:
|
||||
return []
|
||||
|
||||
response_def = spec["paths"][path][method]["responses"][status_code]
|
||||
|
||||
if "content" not in response_def:
|
||||
return []
|
||||
|
||||
return list(response_def["content"].keys())
|
||||
|
||||
|
||||
def get_required_parameters(
|
||||
spec: Dict[str, Any],
|
||||
path: str,
|
||||
method: str
|
||||
) -> List[Dict[str, Any]]:
|
||||
"""
|
||||
Get all required parameters for a path/method.
|
||||
|
||||
Args:
|
||||
spec: The OpenAPI specification
|
||||
path: The API path
|
||||
method: The HTTP method
|
||||
|
||||
Returns:
|
||||
List of parameter objects that are required
|
||||
"""
|
||||
method = method.lower()
|
||||
|
||||
if path not in spec["paths"]:
|
||||
return []
|
||||
|
||||
if method not in spec["paths"][path]:
|
||||
return []
|
||||
|
||||
if "parameters" not in spec["paths"][path][method]:
|
||||
return []
|
||||
|
||||
return [
|
||||
param for param in spec["paths"][path][method]["parameters"]
|
||||
if param.get("required", False)
|
||||
]
|
||||
155
tests-api/utils/validation.py
Normal file
155
tests-api/utils/validation.py
Normal file
@@ -0,0 +1,155 @@
|
||||
"""
|
||||
Validation utilities for API tests.
|
||||
"""
|
||||
import json
|
||||
import jsonschema
|
||||
import yaml
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
|
||||
def load_openapi_spec(spec_path: Union[str, Path] = None) -> Dict[str, Any]:
|
||||
"""
|
||||
Load the OpenAPI specification document.
|
||||
|
||||
Args:
|
||||
spec_path: Path to the OpenAPI specification file
|
||||
|
||||
Returns:
|
||||
The OpenAPI specification as a dictionary
|
||||
"""
|
||||
if spec_path is None:
|
||||
# Default to the root openapi.yaml file
|
||||
spec_path = Path(__file__).parents[2] / "openapi.yaml"
|
||||
|
||||
with open(spec_path, "r") as f:
|
||||
if str(spec_path).endswith(".yaml") or str(spec_path).endswith(".yml"):
|
||||
return yaml.safe_load(f)
|
||||
else:
|
||||
return json.load(f)
|
||||
|
||||
|
||||
def get_schema_for_path(
|
||||
spec: Dict[str, Any],
|
||||
path: str,
|
||||
method: str,
|
||||
status_code: str = "200",
|
||||
content_type: str = "application/json"
|
||||
) -> Optional[Dict[str, Any]]:
|
||||
"""
|
||||
Extract the response schema for a specific path, method, and status code.
|
||||
|
||||
Args:
|
||||
spec: The OpenAPI specification
|
||||
path: The API path (e.g., "/customnode/getlist")
|
||||
method: The HTTP method (e.g., "get", "post")
|
||||
status_code: The HTTP status code (default: "200")
|
||||
content_type: The response content type (default: "application/json")
|
||||
|
||||
Returns:
|
||||
The schema for the specified path and method, or None if not found
|
||||
"""
|
||||
method = method.lower()
|
||||
|
||||
if path not in spec["paths"]:
|
||||
return None
|
||||
|
||||
if method not in spec["paths"][path]:
|
||||
return None
|
||||
|
||||
if "responses" not in spec["paths"][path][method]:
|
||||
return None
|
||||
|
||||
if status_code not in spec["paths"][path][method]["responses"]:
|
||||
return None
|
||||
|
||||
response_def = spec["paths"][path][method]["responses"][status_code]
|
||||
|
||||
if "content" not in response_def:
|
||||
return None
|
||||
|
||||
if content_type not in response_def["content"]:
|
||||
return None
|
||||
|
||||
if "schema" not in response_def["content"][content_type]:
|
||||
return None
|
||||
|
||||
return response_def["content"][content_type]["schema"]
|
||||
|
||||
|
||||
def validate_response_schema(
|
||||
response_data: Any,
|
||||
schema: Dict[str, Any],
|
||||
spec: Dict[str, Any] = None
|
||||
) -> bool:
|
||||
"""
|
||||
Validate a response against a schema from the OpenAPI specification.
|
||||
|
||||
Args:
|
||||
response_data: The response data to validate
|
||||
schema: The schema to validate against
|
||||
spec: The complete OpenAPI specification (for resolving references)
|
||||
|
||||
Returns:
|
||||
True if validation succeeds, raises an exception otherwise
|
||||
"""
|
||||
if spec is None:
|
||||
spec = load_openapi_spec()
|
||||
|
||||
# Create a resolver for references within the schema
|
||||
resolver = jsonschema.RefResolver.from_schema(spec)
|
||||
|
||||
# Validate the response against the schema
|
||||
jsonschema.validate(
|
||||
instance=response_data,
|
||||
schema=schema,
|
||||
resolver=resolver
|
||||
)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def validate_response(
|
||||
response_data: Any,
|
||||
path: str,
|
||||
method: str,
|
||||
status_code: str = "200",
|
||||
content_type: str = "application/json",
|
||||
spec: Dict[str, Any] = None
|
||||
) -> bool:
|
||||
"""
|
||||
Validate a response against the schema defined in the OpenAPI specification.
|
||||
|
||||
Args:
|
||||
response_data: The response data to validate
|
||||
path: The API path
|
||||
method: The HTTP method
|
||||
status_code: The HTTP status code (default: "200")
|
||||
content_type: The response content type (default: "application/json")
|
||||
spec: The OpenAPI specification (loaded from default location if None)
|
||||
|
||||
Returns:
|
||||
True if validation succeeds, raises an exception otherwise
|
||||
"""
|
||||
if spec is None:
|
||||
spec = load_openapi_spec()
|
||||
|
||||
schema = get_schema_for_path(
|
||||
spec=spec,
|
||||
path=path,
|
||||
method=method,
|
||||
status_code=status_code,
|
||||
content_type=content_type
|
||||
)
|
||||
|
||||
if schema is None:
|
||||
raise ValueError(
|
||||
f"No schema found for {method.upper()} {path} "
|
||||
f"with status {status_code} and content type {content_type}"
|
||||
)
|
||||
|
||||
return validate_response_schema(
|
||||
response_data=response_data,
|
||||
schema=schema,
|
||||
spec=spec
|
||||
)
|
||||
Reference in New Issue
Block a user