Skip to content

feat: add essentials_category to nodes and blueprints for Essentials tab#12573

Merged
guill merged 6 commits intomasterfrom
toolkit/wire-essentials-categorization
Mar 15, 2026
Merged

feat: add essentials_category to nodes and blueprints for Essentials tab#12573
guill merged 6 commits intomasterfrom
toolkit/wire-essentials-categorization

Conversation

@christian-byrne
Copy link
Copy Markdown
Contributor

@christian-byrne christian-byrne commented Feb 22, 2026

Summary

Add essentials_category / ESSENTIALS_CATEGORY to 12 node classes and all 36 blueprint JSONs so the frontend Essentials tab can categorize and order them correctly.

Changes

Node classes (12 total):

  • nodes.py: LoadImage, SaveImage, PreviewImage, LoadImageMask
  • nodes_post_processing.py: ImageBlend, ImageCropV2, ImageScaleBy
  • nodes_video.py: Video Slice
  • nodes_audio.py: EmptyLatentAudio, SaveAudioMP3
  • nodes_images.py: ImageCompare (via nodes_image_compare.py)
  • nodes_recraft.py: RecraftVectorizeImageNode
  • nodes_kling.py: KlingOmniProEditVideoNode

Blueprints (36 JSONs):

  • Added essentials_category field to definitions.subgraphs[0] in every blueprint

Backend plumbing:

  • app/subgraph_manager.py: Added essentials_category to SubgraphEntry TypedDict and extraction logic in get_blueprint_subgraphs

Fixes COM-15221

API Node PR Checklist

Scope

  • Is API Node Change

Pricing & Billing

  • Need pricing update
  • No pricing update

If Need pricing update:

  • Metronome rate cards updated
  • Auto‑billing tests updated and passing

QA

  • QA done
  • QA not required

Comms

  • Informed Kosinkadink

Add ESSENTIALS_CATEGORY or essentials_category to 12 node classes and all
36 blueprint JSONs. Update SubgraphEntry TypedDict and subgraph_manager to
extract and pass through the field.

Fixes COM-15221

Amp-Thread-ID: https://ampcode.com/threads/T-019c83de-f7ab-7779-a451-0ba5940b56a9
@notion-workspace
Copy link
Copy Markdown

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f9db29f4-e81e-4111-bd77-9e17e90b1a8d

📥 Commits

Reviewing files that changed from the base of the PR and between d88b19d and 7de1a7d.

📒 Files selected for processing (1)
  • nodes.py

📝 Walkthrough

Walkthrough

Three node classes in nodes.py now include a new public class attribute ESSENTIALS_CATEGORY. The ConditioningCombine class is assigned the category "Image Generation", while both LoadImageMask and ImageScaleBy classes are assigned "Image Tools". These additions introduce categorization metadata without modifying method signatures or altering control flow logic.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding essentials_category to nodes and blueprints for the Essentials tab feature.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, detailing the 12 node classes modified, 36 blueprints updated, and backend plumbing changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can make CodeRabbit's review stricter and more nitpicky using the `assertive` profile, if that's what you prefer.

Change the reviews.profile setting to assertive to make CodeRabbit's nitpick more issues in your PRs.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
app/subgraph_manager.py (1)

106-115: Avoid swallowing blueprint parse errors silently.
The blanket except Exception: pass makes JSON/IO issues hard to diagnose. Consider narrowing the exception and logging at least at debug level.

💡 Suggested tweak
+import logging
...
+logger = logging.getLogger(__name__)
-                except Exception:
-                    pass
+                except (OSError, json.JSONDecodeError) as exc:
+                    logger.debug("Failed to read essentials_category from %s: %s", file, exc)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/subgraph_manager.py` around lines 106 - 115, The try/except is currently
swallowing all errors when reading/parsing blueprint files; change the block
around opening/parsing the file (the with open(...) as f, json.load into
bp_data, subgraphs extraction and setting entry['essentials_category']) to catch
specific errors (json.JSONDecodeError and OSError) and log the exception at
debug or warning level (e.g., logger.debug or logger.warning) including the
filename and error details, while allowing truly unexpected exceptions to
propagate (or re-raise them) so they are not silently ignored.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@app/subgraph_manager.py`:
- Around line 106-115: The try/except is currently swallowing all errors when
reading/parsing blueprint files; change the block around opening/parsing the
file (the with open(...) as f, json.load into bp_data, subgraphs extraction and
setting entry['essentials_category']) to catch specific errors
(json.JSONDecodeError and OSError) and log the exception at debug or warning
level (e.g., logger.debug or logger.warning) including the filename and error
details, while allowing truly unexpected exceptions to propagate (or re-raise
them) so they are not silently ignored.

@christian-byrne christian-byrne marked this pull request as draft February 22, 2026 09:50
christian-byrne added a commit to Comfy-Org/ComfyUI_frontend that referenced this pull request Feb 27, 2026
## Summary

Wire `essentials_category` through from backend to the Essentials tab
UI. Creates a single source of truth for node categorization and
ordering.

### Changes

**New file — `src/constants/essentialsNodes.ts`:**
- Single source of truth: `ESSENTIALS_NODES` (ordered nodes per
category), `ESSENTIALS_CATEGORIES` (folder display order),
`ESSENTIALS_CATEGORY_MAP` (flat lookup), `TOOLKIT_NOVEL_NODE_NAMES`
(telemetry), `TOOLKIT_BLUEPRINT_MODULES`

**Refactored files:**
- `src/types/nodeSource.ts`: Removed inline `ESSENTIALS_CATEGORY_MOCK`,
imports `ESSENTIALS_CATEGORY_MAP` from centralized constants
- `src/services/nodeOrganizationService.ts`: Removed inline
`NODE_ORDER_BY_FOLDER`, imports `ESSENTIALS_NODES` and
`ESSENTIALS_CATEGORIES`
- `src/constants/toolkitNodes.ts`: Re-exports from `essentialsNodes.ts`
instead of maintaining a separate list

**Subgraph passthrough:**
- `src/stores/subgraphStore.ts`: Passes `essentials_category` from
`GlobalSubgraphData` and extracts it from `definitions.subgraphs[0]` as
fallback
- `src/platform/workflow/validation/schemas/workflowSchema.ts`: Added
`essentials_category` to `SubgraphDefinitionBase` and
`zSubgraphDefinition`

**Tests:**
- `src/constants/essentialsNodes.test.ts`: 6 tests validating no
duplicates, complete coverage, basics exclusion
- `src/stores/subgraphStore.test.ts`: 2 tests for essentials_category
passthrough

All 43 relevant tests pass. Typecheck, lint, format clean.

**Depends on:** Comfy-Org/ComfyUI#12573

Fixes COM-15221

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-9091-feat-wire-essentials_category-for-Essentials-tab-display-30f6d73d3650814ab3d4c06b451c273b)
by [Unito](https://www.unito.io)

---------

Co-authored-by: github-actions <github-actions@github.com>
christian-byrne added a commit to Comfy-Org/ComfyUI_frontend that referenced this pull request Feb 27, 2026
## Summary

Wire `essentials_category` through from backend to the Essentials tab
UI. Creates a single source of truth for node categorization and
ordering.

### Changes

**New file — `src/constants/essentialsNodes.ts`:**
- Single source of truth: `ESSENTIALS_NODES` (ordered nodes per
category), `ESSENTIALS_CATEGORIES` (folder display order),
`ESSENTIALS_CATEGORY_MAP` (flat lookup), `TOOLKIT_NOVEL_NODE_NAMES`
(telemetry), `TOOLKIT_BLUEPRINT_MODULES`

**Refactored files:**
- `src/types/nodeSource.ts`: Removed inline `ESSENTIALS_CATEGORY_MOCK`,
imports `ESSENTIALS_CATEGORY_MAP` from centralized constants
- `src/services/nodeOrganizationService.ts`: Removed inline
`NODE_ORDER_BY_FOLDER`, imports `ESSENTIALS_NODES` and
`ESSENTIALS_CATEGORIES`
- `src/constants/toolkitNodes.ts`: Re-exports from `essentialsNodes.ts`
instead of maintaining a separate list

**Subgraph passthrough:**
- `src/stores/subgraphStore.ts`: Passes `essentials_category` from
`GlobalSubgraphData` and extracts it from `definitions.subgraphs[0]` as
fallback
- `src/platform/workflow/validation/schemas/workflowSchema.ts`: Added
`essentials_category` to `SubgraphDefinitionBase` and
`zSubgraphDefinition`

**Tests:**
- `src/constants/essentialsNodes.test.ts`: 6 tests validating no
duplicates, complete coverage, basics exclusion
- `src/stores/subgraphStore.test.ts`: 2 tests for essentials_category
passthrough

All 43 relevant tests pass. Typecheck, lint, format clean.

**Depends on:** Comfy-Org/ComfyUI#12573

Fixes COM-15221

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-9091-feat-wire-essentials_category-for-Essentials-tab-display-30f6d73d3650814ab3d4c06b451c273b)
by [Unito](https://www.unito.io)

---------

Co-authored-by: github-actions <github-actions@github.com>
@christian-byrne christian-byrne marked this pull request as ready for review March 15, 2026 04:33
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
app/subgraph_manager.py (1)

107-116: Avoid swallowing all exceptions during blueprint parsing.

except Exception: pass can hide unexpected bugs and makes failures untraceable. Please narrow the exception types and log parse failures.

🔧 Suggested patch
+import logging
 import os
 import json
@@
+logger = logging.getLogger(__name__)
+
 class SubgraphManager:
@@
-                try:
+                try:
                     with open(file, 'r', encoding='utf-8') as f:
                         bp_data = json.load(f)
                     subgraphs = bp_data.get('definitions', {}).get('subgraphs', [])
-                    if subgraphs:
+                    if subgraphs and isinstance(subgraphs[0], dict):
                         ec = subgraphs[0].get('essentials_category')
-                        if ec:
+                        if isinstance(ec, str) and ec:
                             entry['essentials_category'] = ec
-                except Exception:
-                    pass
+                except (OSError, json.JSONDecodeError, TypeError, AttributeError) as exc:
+                    logger.warning(
+                        "Failed to read essentials_category from blueprint '%s': %s",
+                        file,
+                        exc,
+                    )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/subgraph_manager.py` around lines 107 - 116, The current try/except
around reading and parsing blueprint JSON (the with open(file, 'r', ...) block
that creates bp_data, subgraphs, and sets entry['essentials_category']) swallows
all exceptions; change it to catch and handle specific exceptions
(FileNotFoundError, PermissionError, UnicodeDecodeError, json.JSONDecodeError)
and only those related to I/O/parsing, and log failures with a descriptive
message and the filename/entry id using the module logger instead of silently
passing; do not catch Exception broadly so other bugs surface.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@app/subgraph_manager.py`:
- Around line 107-116: The current try/except around reading and parsing
blueprint JSON (the with open(file, 'r', ...) block that creates bp_data,
subgraphs, and sets entry['essentials_category']) swallows all exceptions;
change it to catch and handle specific exceptions (FileNotFoundError,
PermissionError, UnicodeDecodeError, json.JSONDecodeError) and only those
related to I/O/parsing, and log failures with a descriptive message and the
filename/entry id using the module logger instead of silently passing; do not
catch Exception broadly so other bugs surface.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6c8be10f-8b62-4283-a9d5-4e9879237a71

📥 Commits

Reviewing files that changed from the base of the PR and between ad5b8ca and d88b19d.

📒 Files selected for processing (7)
  • app/subgraph_manager.py
  • comfy_api_nodes/nodes_kling.py
  • comfy_extras/nodes_audio.py
  • comfy_extras/nodes_images.py
  • comfy_extras/nodes_post_processing.py
  • comfy_extras/nodes_video.py
  • nodes.py

@guill guill merged commit 593be20 into master Mar 15, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants