Commit Graph
5865 Commits
Author SHA1 Message Date
benjcooley 2cf2997e8e Fix API V2 source formatting 2026-09-01 13:13:38 -07:00
benjcooley f88f91ead9 Merge remote-tracking branch 'origin/master' into api-v2-runtime 2026-09-01 13:07:43 -07:00
T8star-Aix 3216c62e99 Support SenseNova U1.5 (CORE-411) (#15922) 2026-08-31 20:05:53 -07:00
comfyanonymous d3eaf6adb3 Minimax h3 controlnet as a model patch instead of a controlnet. (#15975) 2026-08-31 19:44:42 -04:00
comfyanonymous a8b4fa6410 Add how to cache model stuff to AGENTS.md (#16003) 2026-08-31 19:09:43 -04:00
benjcooley beaf5a6028 chore: clean API V2 lint findings 2026-08-31 15:22:30 -07:00
benjcooley cbec256afd fix: keep V2 API import independent of core 2026-08-31 15:17:22 -07:00
benjcooley cc8f860720 fix: load converted packs from their V2 entrypoint 2026-08-31 13:32:20 -07:00
benjcooley dc14475068 test: prove local packs prefer the V2 entrypoint 2026-08-31 13:30:43 -07:00
benjcooley 97ff14ef4f feat: enforce API V2 runtime profiles 2026-08-31 13:26:00 -07:00
benjcooley 0733f88f8e Clamp system metrics to safe integers 2026-08-31 12:50:58 -07:00
benjcooley 4c665f3263 Expand secure V2 SDK surface 2026-08-31 12:50:58 -07:00
benjcooley ed6abc963d Make comfy_api importable without ComfyUI core 2026-08-31 12:49:46 -07:00
benjcooley e0cac3e150 feat(execution): route legacy custom nodes through backend 2026-08-31 12:49:46 -07:00
benjcooley 58f175c470 feat(sdk): transport unchanged V2 node values 2026-08-31 12:49:46 -07:00
benjcooley 19ae4ffaf9 feat(io): publish MAX_RESOLUTION on the io surface
Pack schemas use it for input bounds, and the module that has always
defined it (nodes.py) is a host module a sandboxed pack cannot import.
Same value by definition: 16384 is frozen into every workflow that
ever serialized a bound.
2026-08-31 12:49:46 -07:00
benjcooley dc2e9ac1ec feat(sdk): model transforms, preview/profiling surfaces, structured-vs-live ref boundary
The V2 additions the KJNodes completion needed on the core side:

- _model_transforms: the closed, core-owned transform vocabulary
  behind ModelRef.patch — 29 named transforms, declaratively
  parameterized, validated host-side, immutable and stacking. No
  function ever crosses the boundary; a pack cannot register one.
- structured-vs-live split: value()/from_value() only on structured
  data refs (LATENT, AUDIO, TRACKS...). MODEL/CLIP/VAE/asset refs are
  handles in every execution mode — in-process identity resolution no
  longer hands a live model to node code.
- preview overrides (tiny-VAE, LTX factors), triton VAE seam, memory
  attention, and profiling surfaces backing the corresponding closed
  brokers in the overlay.
- torch_compile/model_patcher/model_management: compiled-view
  aliasing recognized by the model manager (no double-counted
  weights); shared state-dict loading path so the native loader and
  the V2 broker cannot drift.
2026-08-31 12:49:46 -07:00
benjcooley 98cfc5fd73 feat(sdk): handle ops for live engine objects; host-authoritative refs
VaeRef.decode/encode, ClipRef.tokenize/encode_from_tokens_scheduled/encode,
CondRef.combine/concat, with in-process implementations behind the existing
named-op registry so an overlay extends the vocabulary without touching the
contract.

These keep the old API's shape on purpose — you still write vae.decode(latent)
— and change only what the call means: the node holds a handle, awaits, and the
decode runs on the trusted plane against weights it never sees. That is what
lets a node DECLARE a VAE input and still be sandboxable. Compatible in shape so
conversion is mechanical across a corpus nobody here maintains; different in
substance so a converted node is sandboxable by construction.

Two mirroring defects fixed before shipping: encode() sliced its input to three
channels (core's VAEEncode does not, so it silently dropped alpha), and ClipRef
offered only a combined encode(text) (CLIPTextEncodeSDXL builds one token dict
from two prompts, and the ACE nodes pass a dozen tokenizer kwargs, so the
collapse made both inexpressible).

InProcessRefResolver now records a ref's kind at creation and checks it at
resolve. Ref tokens cross as {kind, id, cls} and the host rebuilt from what
arrived, so the holder chose its own ref's type: an ImageRef id could be
presented as a VaeRef. Unguessable ids already stopped a guest reaching a handle
it was never given; possessing a handle is not the same as labelling it.

Release is explicit, not collected. InProcessRefResolver.clear() drops the
table's strong references at a known point, called from execution.py in a
finally so it also covers the path where the node raised or its guest died —
which is exactly when nothing else will run. A ref table can hold multi-gigabyte
tensors, and refcount timing neither crosses a process boundary nor is bounded
under reference cycles.

OpsProvider.apply is annotated (op, subject: Ref, params) -> Any; it claimed
ImageRef in and out while handle ops take a VaeRef and may return a LatentRef,
a CondRef, or a plain token dict.
2026-08-31 12:49:46 -07:00
benjcooley c4e665118e feat(sdk): live engine objects cross the seam as refs; nodes declare permissions
Two generic gaps that blocked an out-of-process node from being a sampler.

1. wrap_inputs only wrapped tensors and latents. A MODEL or CONDITIONING is a
   live engine object, so it passed straight through — and an out-of-process
   backend cannot serialize a ModelPatcher, so any node taking one simply could
   not run in a guest. The rule is now by capability rather than an enumerated
   type list: a value that can cross as data does, and anything else becomes a
   handle. That is the correct boundary rule anyway — objects do not cross,
   handles do — and it is what lets a node take a MODEL and still run isolated.

2. ExecutionPlan.permissions was never populated, so the seam could not tell a
   backend what a node needs. A node now declares SDK_PERMISSIONS and the seam
   copies it onto the plan. Declaring is not granting: the backend decides, and
   an out-of-process one still gates every call at the wire. Nodes that declare
   nothing — the overwhelming majority — get nothing.

Behaviour-preserving in-process: 54 core seam tests and 26 overlay tests pass.
2026-08-31 12:49:46 -07:00
benjcooley 6f4b46a204 fix(sdk): unwrap_outputs must preserve ui/expand/block_execution
`unwrap_outputs` rebuilds a node's NodeOutput in order to swap output refs back
for real objects. It rebuilt it from the results alone — `NodeOutput(*resolved)`
— silently discarding `ui`, `expand` and `block_execution`.

The practical effect: no SDK_REFS node could be an output node. ComfyUI only
emits the `executed` websocket event, the one that delivers a node's results to
the frontend, for nodes that return ui data (`if len(output_ui) > 0`). So a
converted PreviewImage-style node executed perfectly and then displayed
nothing, with no error anywhere to explain it. `expand` (subgraph expansion)
and `block_execution` were lost the same way.

Resolving refs is a transport concern and has no business changing what the
node said. Generic fix, not specific to any backend: it applies equally to the
in-process path.
2026-08-31 12:49:46 -07:00
benjcooley 1684d15089 feat(sdk): generic image.op(name, **params) transport — op vocabulary is data, not API surface
Replaces enumerated invert/scale methods on OpsProvider with generic dispatch:
apply(op, image, params) + supports(op) + a built-in registry {invert, scale}
+ register_op. ImageRef.op(name, **params) is the untyped transport seam;
invert()/scale() remain as built-in convenience. Adds OpNotSupported (carries
the capability name) so a node can fall back to the raw tier. An overlay now
extends the op vocabulary without touching OSS core.

Statically-typed op methods live on the secure-lib side (per guidance), not
here — core stays a generic seam.
2026-08-31 12:49:46 -07:00
benjcooley 342b12ab6d feat(sdk): execution seam carries the work unit — plan.inputs/node_module, dispatch(plan, local_call, runtime)
Generic out-of-process enablement: the ExecutionPlan now ships the node's
module spec and ref-wrapped inputs, and dispatch receives the per-node host
runtime (refs/ctx/ops) so an external backend can execute the node elsewhere
and broker guest calls against the same ref table. In-process default ignores
all of it; legacy nodes unaffected (seam tests green).
2026-08-31 12:49:46 -07:00
benjcooley cf167e2b4f feat(sdk): ops-first asset interface — OpsProvider seam, SDK_REFS marshaling, raw() escape hatch
Nodes operate on assets (image.invert()) and never receive buffers; compute
runs on the trusted plane via the OpsProvider seam. Raw buffer access becomes
a permissioned, discouraged escape hatch (raw(); forces dedicated tier under
the overlay). The execution seam wraps heavy inputs as refs for SDK_REFS
nodes and resolves output refs for downstream legacy nodes. The .pyi contract
no longer imports torch.

POC stand-ins (interface debt, ledgered in the overlay repo DEBT.md):
invert/scale enumerated on OpsProvider; duck-typed wrap_inputs; SDK_REFS
class-attr opt-in.
2026-08-31 12:49:46 -07:00
benjcooley 1f07da19ac feat(sdk): wire execution seam + .pyi contract + POC node & test
- execution.py: route V3 node dispatch through providers.execution_backend
  with a behavior-preserving local_call closure (exact sync/async-task
  semantics retained); bind per-node ctx+refs inside the invocation scope so
  the concurrent-async path is correct. V1 nodes untouched. Default backend =
  in-process => byte-identical to today.
- comfy_api/latest/_sdk_public.pyi: authoritative type contract for the secure
  SDK (backend analog of the frontend comfy-api.d.ts): refs, ctx + domains,
  ctx() accessor; host/overlay seam separated.
- custom_nodes/comfy_sdk_poc: SandboxInvert POC node authored to the SDK.
- tests-unit: seam regression (sync+async SDK nodes through the real engine;
  provider-swap intercept). Verified PASS.
2026-08-31 12:49:46 -07:00
benjcooley ccf67659b1 feat(sdk): custom-node SDK seam — refs, ctx, provider registry, overlay loader
Establishes the open-source 'key Python API' for secure custom nodes:
- comfy_api/latest/_sdk.py: opaque typed refs (ImageRef/ModelRef/AssetRef...),
  a brokered ctx surface (assets/progress/scratch/events/storage + stubs),
  and a Providers registry (ExecutionBackend/CtxProvider/RefResolver) with
  in-process DEFAULTS so OSS behaves exactly as today (a ref wraps the real
  object; ctx is a passthrough; zero-copy, zero-overhead).
- load_overlay(): env-var (COMFY_OVERLAY_MODULE) path loader that lets a
  separable, proprietary cloud overlay register isolated implementations at
  the seam. Unset => pure OSS. Wired guarded into main.startup.
- comfy_api/v0_0_3: new API version exposing sdk; registered in version_list.

Nothing isolation-specific lives in OSS: this is the seam, not the engine.
2026-08-31 12:49:36 -07:00
comfyanonymous 95d755cd81 Disable push event trigger for failing workflow. (#15995) 2026-08-30 23:19:14 -04:00
Terry Jia f938505952 feat: add VideoTrim and VideoCrop nodes with VIDEO_EDIT widget inputs (#15637) 2026-08-30 15:54:48 -07:00
comfyanonymous 8a33128f2f Improve some warning messages. (#15977) 2026-08-29 20:10:20 -04:00
Alexander Piskun 5bdcb5f4ed [Partner Nodes] fix(HeyGen): update Avatar Video price badge (#15945)
Signed-off-by: bigcat88 <bigcat88@icloud.com>
2026-08-29 21:53:58 +04:00
comfyanonymous e7051b0375 Add section about user input tolerance to AGENTS.md (#15955) 2026-08-28 20:00:29 -04:00
Jukka Seppänen 2504e68d4d MiniMax-H3: Support PDD LoRA (#15908) 2026-08-28 18:12:36 -04:00
comfyanonymous 3ac5d7941d Add cfgpp_ud10_ab sampler. (#15951)
This is the result of an experiment where I asked a LLM to create a better
sampler for the base Anima model and gave it a lot of different things to
try.

I wouldn't call this revolutionary but from my basic testing it seems to be
a bit better than the other samplers at lower steps so I have decided to
include it in ComfyUI.

For best result use it at CFG 2.0 on base Anima. It should also work on
other models but I'm not sure about the optimal parameters.
2026-08-28 15:33:18 -04:00
comfyanonymous 0a33ed6c28 Add to readme that we support HDR and high bit depth. (#15940) 2026-08-27 22:57:30 -04:00
Terry Jia a255b96872 feat(3d): File3DToMesh node — parse GLB/GLTF/OBJ/STL into MESH (#15919) 2026-08-27 18:35:30 -07:00
Alexander PiskunandPurz 4c6359f2e3 [Partner Nodes] feat(Google-Omni): add support for Omni 1.1 model (#15929)
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
Co-authored-by: Purz <97489706+purzbeats@users.noreply.github.com>
2026-08-27 18:29:35 -04:00
Daxiong (Lin) e20d433a49 chore: update workflow templates to v0.11.50 (#15931) 2026-08-27 12:21:54 -07:00
Alexander Piskun 77739723a3 fix(memory): respect the container cgroup memory limit instead of host RAM (#15927) 2026-08-27 07:57:31 -07:00
Alexander Piskun d8e7bbc9d5 fix(video): remux HEVC to mp4/mov as hvc1 via hevc_mp4toannexb (#15809) 2026-08-26 20:28:50 -04:00
comfyanonymous 5653b4ac8e Support avif in Save Image Advanced node. (#15891) 2026-08-26 19:17:57 -04:00
Comfy Org PR Bot 40b9898582 Bump comfyui-frontend-package to 1.51.9 (#15696) 2026-08-26 16:05:39 -07:00
Alexander Piskun a25c7bf2b8 [Partner Nodes] feat(WAN): add WAN3-Prime model support (#15894)
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2026-08-26 22:26:03 +04:00
Alexander Piskun 30d03fea0a [Partner Nodes] feat(Recraft): add V4 Styles (#15903)
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2026-08-26 22:22:22 +04:00
Alexander Piskun b133e48368 [Partner Nodes] chore(Google): drop retiring Veo 2 and Veo 3.0 models (#15883)
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2026-08-26 12:30:06 +04:00
comfyanonymous 12d5279438 ComfyUI v0.34.0 v0.34.0 2026-08-25 17:58:26 -04:00
Daxiong (Lin) ef0d752e5e Update workflow templates to v0.11.48 (#15888) 2026-08-25 13:29:16 -07:00
Alexander Piskun 7d9d0c391b [Partner Nodes] feat(Pixverse): add Pixverse V6 model support (#15880)
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2026-08-25 23:40:46 +04:00
rattus 7a054eb472 comfy-aimdo 0.4.15 (#15886)
Comfy-aimdo 0.4.15 fixes the headroom on the NVML pressure mechanism.
Some system have only NVML as the pressure out and this could cause
shared VRAM spills. This bumps the headroom to 512MB.

I never reproduced this issue.
2026-08-25 12:12:40 -04:00
Alexander Piskun a1079ba16f [Partner Nodes] chore(Tripo): remove retired Refine node and v2.0 model version (#15851)
Signed-off-by: bigcat88 <bigcat88@icloud.com>
2026-08-25 10:25:23 +04:00
comfyanonymous 2618d32dfb Python 3.10 will be EOL soon, please upgrade. (#15874)
After the Python 3.10 EOL date of October 31 2026 we will put zero effort into keeping support for python 3.10 so everyone is recommended to upgrade to a newer version.
2026-08-24 23:09:38 -04:00
Constantineandguill 5f0c4e18cb Fix default database path for custom user directory (#14539)
* fix: respect user directory for default database

* refactor: use None default for --database-url instead of argv scan

Per review: default --database-url to None and treat a non-None value
as explicit at resolution time. Removes the sys.argv scan and the
database_url_explicit attribute. database_default_path now serves
directly as the legacy copy source. Adds regression tests for the
unchanged no-flag default path and explicit URLs at the legacy
location.

* refactor: rename legacy database to .bak after copy

Per review: after copying the legacy install-dir database to the
effective user directory, rename the original to comfyui.db.bak so a
later launch without --user-directory cannot silently fall back to a
diverged copy, while keeping the file around for recovery. Also hoist
the database_default_path import to module scope.

* fix: guard legacy migration on existing .bak and rename before copy

Per review: bail out of the legacy migration when comfyui.db.bak
already exists, so only the first run migrates and later launches with
a fresh --user-directory cannot grab a database another instance is
using. Rename before copy so os.replace fails fast if the legacy DB is
held open by a running instance.

---------

Co-authored-by: guill <jacob.e.segal@gmail.com>
2026-08-24 16:19:03 -07:00