Commit Graph

1623 Commits

Author SHA1 Message Date
Comfy Org PR Bot
cfabeb0821 0.14.4 (#988)
Patch version increment to 0.14.4

Co-authored-by: webfiltered <176114999+webfiltered@users.noreply.github.com>
2025-05-01 10:34:51 +10:00
filtered
0cdee75460 [API] Allow canvas font customisation (#987)
Allows customisation of fonts via `LiteGraph` global var:

```ts
LiteGraph.NODE_FONT = "wingdings"
```


![image](https://github.com/user-attachments/assets/36bec38d-ea5f-4ec6-a2a3-bc5a57826c1e)
2025-05-01 00:19:36 +00:00
filtered
c695b2e2bd Fix LGraph attach/detach canvas silently fails (#986)
Attach would allow duplicate entries.
Detach left the canvas.graph property set, if list_of_graphcanvas was
not set.
2025-04-30 18:10:45 +00:00
filtered
2f0e3d35d3 [CodeHealth] Standardise code in processKey (#985) 2025-04-30 08:23:38 +00:00
filtered
64d1225037 [Refactor] Convert to generic CustomEventTarget (#983)
Converts LinkConnector event target to a generic class.

Subgraph pre-requisite.
2025-04-28 22:19:26 +00:00
filtered
be92f5bdbb [Refactor] Move slot code out of LGraphNode (#981)
Moves collapsed node slot render code to the slot instances.
2025-04-28 17:35:45 +00:00
filtered
ccc588b842 [API] Remove unused: LGraphNode.addConnection (#980)
Confirmed unused via code search
2025-04-28 01:52:53 +00:00
Comfy Org PR Bot
85f677f58c 0.14.3 (#979)
Patch version increment to 0.14.3

Co-authored-by: webfiltered <176114999+webfiltered@users.noreply.github.com>
2025-04-28 05:51:38 +10:00
filtered
ee222c794b Fade invalid increment/decrement widget buttons (#978)
When a widget cannot be incremented/decremented further, show a disabled
effect on the widget buttons.


https://github.com/user-attachments/assets/7770a9f1-31f6-430b-ab02-420327621148
2025-04-28 05:47:48 +10:00
filtered
85b1534263 [API] Send optional pointermove event with onDragStart. (#977)
Sends the `pointermove` event that triggered `onDragStart` with the
callback.

It is possible for no `pointermove` events to occur, but still be far
from the original `pointerdown` event. In this case, `eMove` will be
`undefined`, and `onDragEnd` will be called immediately after
`onDragStart`.
2025-04-27 17:01:38 +00:00
filtered
81a00b5e6c [Refactor] Remove repeat interface definitions (#976)
Prefers param destructuring over manual impl.
2025-04-27 16:30:59 +00:00
filtered
47732404cd Remove Rename Slot option from input sockets (#975)
This menu option was unintentionally inherited from input slots.

- Ref: https://github.com/Comfy-Org/ComfyUI_frontend/issues/3654
2025-04-27 15:47:22 +00:00
filtered
b3d030e36b [API] Add LLink.resolve static / instance methods (#974)
- `LLink.resolve`: Resolves all IDs on the link to their respective
objects (node IDs, slot indexes)
- `LinkNetwork.getLink`: a more concise pattern to resolve links
2025-04-26 20:51:41 +00:00
filtered
8e8818c24d Minor subgraph ts fixes (#973) 2025-04-26 20:34:02 +00:00
filtered
8e414ab133 [Refactor] Abstract legacy link colour properties (#972)
Replaces colour context interface with a simple abstraction object /
interface.
2025-04-26 20:31:43 +00:00
Comfy Org PR Bot
0b46288d32 0.14.2 (#971)
Patch version increment to 0.14.2

Co-authored-by: webfiltered <176114999+webfiltered@users.noreply.github.com>
2025-04-26 17:12:00 +00:00
filtered
5c41e4e09c Add virtual slots to Reroutes (#970)
### Virtual helper "slots"

Adds a virtual input and output slot to native reroutes, allowing links
to be dragged from them to other reroutes or nodes.


https://github.com/user-attachments/assets/67d308c4-4732-4b04-a2b9-0a2b0c79b413

### Notes

- Reroute slots automatically show an outline as the pointer gets close
- When the slot is clickable, it will highlight in the same colour as
the reroute
- Enables opposite direction connecting: from reroute to node outputs
- Floating reroutes only show one slot - to whichever side is not
connected
2025-04-27 03:00:01 +10:00
Comfy Org PR Bot
de0f0ebac1 0.14.1 (#969)
Patch version increment to 0.14.1

Co-authored-by: webfiltered <176114999+webfiltered@users.noreply.github.com>
2025-04-26 02:34:16 +10:00
filtered
38dd58ae23 Fix new link follows pointer until context menu closed (#968)
- Resolves https://github.com/Comfy-Org/ComfyUI_frontend/issues/3618
2025-04-26 02:33:28 +10:00
filtered
c10ce1caa1 [API] Add deprecated warning logging (#967)
Adds a global API to notify devs / users of deprecated features.

- Custom callbacks may be added
- By default, remembers message text and only sends each message once
- Sends to console.warn by default

```ts
// Add a custom notification when a warning is encountered
const warnMessage = (message: string, source?: object) => {
  addToast({ message, detail: object })
}
LiteGraph.onDeprecationWarning.push(warnMessage)
```

```ts
// Debugging flag. Repeats deprecation warnings every time they are reported.
// May impact performance.
LiteGraph.alwaysRepeatWarnings = true
```

Generate a warning
```ts
import { warnDeprecated } from "@/utils/feedback"

warnDeprecated(
  "[DEPRECATED] graph.oldFeature() will be removed from Litegraph. " +
  "Please use graph.newFeature() instead. https://helpful.site/faq",
  objectThatCausedThis
)
```
2025-04-26 02:16:01 +10:00
filtered
63407abf3c Reduce input socket hitbox for widgets (#966)
Restores the full left-arrow button click area for widgets. Previously
lost ~5 canvas pixels to clicks intercepted by input sockets.

Supporting refactors:
- Maps concrete node slot impls. to private array, once per frame
- Converts slot boundingRect to use absolute canvas pos (same as other
elements)
- Stores parent node ref in concrete slot classes
2025-04-25 14:12:09 +00:00
Comfy Org PR Bot
0fd47a767d 0.14.0 (#964)
Minor version increment to 0.14.0

Co-authored-by: webfiltered <176114999+webfiltered@users.noreply.github.com>
2025-04-25 00:33:35 +10:00
filtered
080a8da8f4 Overhaul node computeSize - use actual text width (#962)
### Node resize overhaul

- Precisely calculates node minimum size
- Prevents input & output overlap
- Prevents (normal*) widgets from rendering text over the edge of nodes
- Performance impact was sub-millisecond for normal usage in a 500-node
graph


![image](https://github.com/user-attachments/assets/5b6a6cc7-a752-4d7e-bcdf-b4bc8df26c51)

_Minimum size for a few example node configurations_

### Widgets

- Converts hard-coded draw render values to class static properties
- Adds widget button draw function for left/right arrow widgets

_*_ Exception: `control_after_generate`, as it is not a true input /
widget. A check may be added later to handle this special case.
2025-04-25 00:31:34 +10:00
filtered
79ce3199d4 [Cleanup] Documentation (#963)
Adds / cleans JSDoc.
2025-04-24 22:47:20 +10:00
filtered
d70260615b [Refactor] Split NodeSlot out to separate files (#960)
Split files only; no code changes.  New files moved to `/node`.
2025-04-23 14:43:55 +00:00
Chenlei Hu
cbbbb9c694 [Cleanup] Remove LGraphNode.isValidWidgetLink (#959)
Ref: https://github.com/Comfy-Org/ComfyUI_frontend/pull/3549
2025-04-21 15:50:14 -04:00
filtered
a28effc9f1 Add socketless widget option (#958)
Declares `socketless` property on `IWidgetOptions`.

- Ref: https://github.com/comfyanonymous/ComfyUI/pull/7714
2025-04-21 19:36:38 +00:00
Comfy Org PR Bot
e06e8c0a3f 0.13.8 (#957)
Patch version increment to 0.13.8

Co-authored-by: webfiltered <176114999+webfiltered@users.noreply.github.com>
2025-04-22 02:12:27 +10:00
filtered
58d8f10e40 [API] Add disconnect links method to LinkConnector (#956)
Provides a simple API for consumers to drag & drop links into a bin /
void, in order to disconnect them.
2025-04-21 16:10:27 +00:00
Comfy Org PR Bot
ddfd89df60 0.13.7 (#955)
Patch version increment to 0.13.7

Co-authored-by: webfiltered <176114999+webfiltered@users.noreply.github.com>
2025-04-22 00:04:58 +10:00
filtered
78bd6704fe Improve slot render stability & perf (#954)
- `draw` is now skipped for slots that should not be shown (prev. drawn
with 0 alpha)
- Fixes slot always rendered when widget not found in `node.widgets`
- Remove redundant check from `isWidgetInputSlot` - type is already
`INodeInputSlot`
2025-04-22 00:03:00 +10:00
filtered
2ad1481f02 Remove LayoutElement, resolve root TS issues (#953)
- Converts type assertions to use inference via discriminated unions
- Removes the LayoutElement class (only used by node slots, and recently
reduced to a single function)
- Splits `boundingRect` property out from `Positionable` interface
- Slots now use the standard `boundingRect` property
- Perf improvements / Removes redundant code
2025-04-21 22:23:09 +10:00
filtered
f7a0a92f3a [CodeHealth] Standardise code (#951)
Refactors & standardises code.
2025-04-20 15:02:54 +00:00
filtered
7c236bcfc8 [API] Remove broken: node.addInputs & addOutputs (#950)
The current impls. do not work as intended; they will only assign the
additional info properties if there are at least three items in the
input array.

Adding replacements would be trivial, if required, and would benefit by
not inheriting the current public interface.

Confirmed unused via code search.
2025-04-20 12:59:23 +00:00
Comfy Org PR Bot
b6a04d245b 0.13.6 (#949)
Patch version increment to 0.13.6

Co-authored-by: webfiltered <176114999+webfiltered@users.noreply.github.com>
2025-04-20 11:26:31 +00:00
filtered
cc5aece6b6 [API] Mark ContextMenu methods as deprecated, cleanup (#948)
- Marks unused static methods as deprecated
- Removes redundant / orphaned code
- Uses existing AbortController to remove all root listeners
2025-04-20 11:25:25 +00:00
filtered
21a3f56187 [API] Allow new node to be created without links (#947)
When using the Add Node context menus, allows consumers to prevent new
nodes from being linked.

- Related: #946
2025-04-20 10:55:52 +00:00
filtered
a76c50252b Fix part of snapped link follows pointer (#945)
Removes the green circle that always follows the pointer, even when a
link is snapped elsewhere.
2025-04-20 08:52:01 +00:00
filtered
c607c53543 [API] Return ContextMenu created for connecting link (#944)
Allows further customisation / hooks of the created ContextMenu.
2025-04-20 18:50:42 +10:00
filtered
b988238155 [Cleanup] Assorted minor code clean-up (#943)
Adds one warning log for an extreme edge case.
2025-04-20 08:35:45 +00:00
filtered
48bf415e52 [API] Allow connecting to nodes without known slot (#942)
Allows better downstream customisation of `LinkConnector`.
2025-04-20 08:20:12 +00:00
Comfy Org PR Bot
13db014387 0.13.5 (#941)
Patch version increment to 0.13.5

Co-authored-by: huchenlei <20929282+huchenlei@users.noreply.github.com>
2025-04-19 22:25:05 -04:00
Chenlei Hu
453257cd30 [Bug] Remove unused prop LayoutElement.value (#940)
Resolves https://github.com/Comfy-Org/litegraph.js/issues/939

The prop is unused and is causing object clone circular ref issue.
2025-04-19 22:23:49 -04:00
Christian Byrne
7c88bda647 Add optional icon to LGraphBadge and use for API nodes (#930)
Adds option to include an icon when creating an `LGraphBadge`. Then,
adds the icon to the title of nodes whose `constructor.nodeData` has a
non-null `credits_cost` property (API nodes that ComfyUI_frontend was
able to successfully query a credit cost for).


![Selection_1228](https://github.com/user-attachments/assets/9b63c0d1-b25b-4066-858f-7f32488eeb38)


- https://github.com/Comfy-Org/ComfyUI-private/pull/2
- https://github.com/Comfy-Org/litegraph.js/pull/930
- https://github.com/Comfy-Org/ComfyUI_frontend/pull/3470

---------

Co-authored-by: filtered <176114999+webfiltered@users.noreply.github.com>
2025-04-20 10:10:45 +10:00
Christian Byrne
deeed9853c Remove fetch-templates script invoke in CI (#938)
See https://github.com/Comfy-Org/ComfyUI_frontend/pull/3500 for details.
2025-04-19 16:41:43 -07:00
Comfy Org PR Bot
5100bf6b00 0.13.4 (#937)
Patch version increment to 0.13.4

Co-authored-by: webfiltered <176114999+webfiltered@users.noreply.github.com>
2025-04-18 16:14:23 +00:00
filtered
6293b4bbe0 Disconnect moved output links when dropped on canvas (#936)
- Resolves #884
2025-04-18 23:22:28 +10:00
filtered
02d165bf2a [API] LinkConnector reset no longer run after drop (#935)
`reset()` is no longer automatically called after `dropLinks`. This
brings the API in line with original intent, and how canvas is already
configured; reset is called by `pointer.finally()`.
2025-04-18 11:45:36 +00:00
filtered
5c76bec611 [TS] Export types (#933)
Re-exports module-level exports at the package level.
2025-04-18 21:01:10 +10:00
filtered
ce46f19de9 Fix LinkConnector methods cannot be cancelled via API (#934)
- Checks if `e.preventDefault()` has been called for all cancellable
LinkConnector callbacks
- Sets `cancelable: true` on dispatched events
- Dedupes canvas pointer calls
2025-04-18 20:50:33 +10:00