Files
vantang-ComfyUI-MediaHub/docs/RETROSPECTIVE_PROVIDER_ISOLATION.md
Van/攻城狮鹿鸣君 e233b0e89a make sample workflows teach portable integration
Treat prompts and source media as user-owned inputs, keep MediaHub credentials/config/execution in one reusable middle block, and reserve outputs for Preview/Save nodes.

Constraint: Samples must show users exactly which block to copy into an existing workflow.

Rejected: Classifying API Key and execution nodes as inputs or outputs | exposes internal mechanics and weakens sample readability.

Confidence: high

Scope-risk: narrow

Directive: Keep sample responsibilities separated and all connections flowing left to right.

Tested: 124 pytest tests; JavaScript syntax; Python compilation; JSON validation; live ComfyUI accepted all eight prompt structures.

Not-tested: Manual visual import of all eight revised examples.
2026-06-13 18:43:39 +08:00

2.2 KiB

Provider Isolation Retrospective

Last updated: 2026-06-13

What Worked

  • Provider adapters are isolated packages behind registered operations.
  • Provider config nodes own documented provider parameters.
  • Generic execution nodes keep API keys and ComfyUI media conversion outside provider request builders.
  • Live probes resolved ambiguous Agnes image and video behavior before release.
  • Architecture tests enforce provider and media-family boundaries.

What Needed Correction

  • The first workflow generator reused the API fixture's mechanical row-major grid. It produced valid workflows but obscured data flow with uniform node sizes, wrapped connections, and an oversized API Key node.
  • API fixtures and user-facing workflows serve different purposes and must not share a visual-layout standard.
  • The API Key visibility control originally consumed a second widget row. A compact inline password field and toggle is clearer.

Current Workflow Standard

  • Left region: only prompt and source media nodes already owned by the user's workflow.
  • Middle region: the complete portable MediaHub integration block: API Key, provider config, and generic Generate/Submit/Resolve execution nodes.
  • Right region: only Preview/Save output nodes.
  • scripts/layout_examples.py applies the canonical layout, and tests lock it.

Media-Family Isolation

  • Image and video have separate result contracts, services, typed ComfyUI requests, execution nodes, provider operations, workflows, and tests.
  • They share only provider-neutral request/job routing and the operation registry.
  • Music/audio must be added as an independent vertical slice rather than as a branch inside image or video services.
  • nodes.py and mediahub/providers/__init__.py remain shared composition roots, so additions there must be registration/export-only changes.

Next-Agent Standard

  1. Save dated official documentation and probe ambiguous live behavior.
  2. Implement one complete, isolated provider capability.
  3. Create API fixtures and separately designed user-facing workflows.
  4. Run unit, architecture, static, JSON, and restarted ComfyUI smoke tests.
  5. Manually inspect at least one image and one async workflow when applicable.