Skip to content

feat(nodes): propagate conditioning prompt and text encoder metadata (Stage 2) - #10172

Open
skunkworxdark wants to merge 14 commits into
invoke-ai:mainfrom
skunkworxdark:feat/conditioning-metadata
Open

skunkworxdark wants to merge 14 commits into
invoke-ai:mainfrom
skunkworxdark:feat/conditioning-metadata

Conversation

@skunkworxdark

@skunkworxdark skunkworxdark commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

In Stage 1 (#10083), native metadata building and emission was unified across all 19 image and video denoise invocations for generation-level parameters (dimensions, steps, CFG/guidance, scheduler, seeds, main model, VAE, transformer LoRAs, and ControlNets/adapters). However, prompts, standalone text encoders, encoder-specific LoRAs, and conditioning modifiers still required manual metadata wiring or wrapper nodes because conditioning edges carried only raw tensor names.

Stage 2 extends metadata propagation upstream along the conditioning edge (*ConditioningField), enabling text encoders, modifier nodes, and denoisers to propagate provenance automatically without extra graph wiring or breaking existing workflows:

  • Conditioning Fields Extended: Added optional metadata attributes (prompt, style_prompt, loras, standalone text encoders, and modifier flags) with default=None across all 16 *ConditioningField classes in invokeai/app/invocations/fields.py.
  • Text Encoder Invocations (18 invocations): All text encoder invocations populate their output *ConditioningField with prompt, standalone text encoder models (t5_encoder, clip_embed_model, clip_l_model, clip_g_model, mistral_encoder, qwen3_encoder, qwen3_vl_encoder, etc.), and text-encoder LoRAs.
  • Conditioning Modifier Preservation: Krea2ConditioningRebalanceInvocation, Krea2SeedVarianceInvocation, ZImageSeedVarianceEnhancerInvocation, and ConditioningInvocation (masking) now use non-mutating self.conditioning.model_copy(update={...}), ensuring that upstream prompt, model, and LoRA provenance flows unbroken through arbitrarily chained modifiers.
  • Shared Conditioning Extractor (extract_conditioning_metadata): Implemented in invokeai/app/invocations/metadata.py and integrated into _build_metadata() across all 19 base denoise invocations:
    • Port-aware polarity: positive_conditioning sets positive_prompt; negative_conditioning sets negative_prompt.
    • LoRA merging: Combines text-encoder LoRAs with transformer/UNet LoRAs into loras.
    • Modifier extraction: Automatically extracts rebalance_* (Krea-2), seed_variance_* (Krea-2 and Z-Image), and layout/caption metadata (flux3_caption, ideogram4_caption, moss_image_layout_prompt).
    • Style prompts: Preserves SDXL positive_style_prompt and negative_style_prompt.
  • Conditioning Collections & Multi-Prompt Workflows:
    • When multiple conditionings are gathered (e.g. via Collect node into denoise), unmasked non-empty prompts (mask is None) are joined with ", " into positive_prompt (and analogously for negative_prompt), keeping single-string UI consumers and gallery recall complete while preventing masked regional prompts from leaking into the global prompt. When every conditioning in a collection is masked, all non-empty prompts are joined with ", " as a complete summary fallback while keeping each region separate.
    • The full collection of raw strings is recorded in positive_prompts: list[str] (and negative_prompts: list[str]), avoiding ambiguous delimiter parsing and preserving exact raw prompt strings.
    • SDXL Refiner Style-Prompt Preservation (denoise_latents): Downstream SDXL refiner passes remap .style conditioning text to refiner_positive_style_prompt / refiner_negative_style_prompt and preserve the base pass's denoising_start, denoising_end, positive_prompt, negative_prompt, positive_style_prompt, and negative_style_prompt.
    • regions is emitted only for conditionings carrying a regional mask (mask is not None), keeping unmasked global prompts out of regions while positive_prompts preserves every collected prompt, and Gallery Image Details (previewMetadata.ts) displays both Canvas positivePrompt and backend positive_prompt region entries.
    • Added positive_prompts, negative_prompts, refiner_positive_style_prompt, and refiner_negative_style_prompt to CORE_LABELS and CORE_LABELS_STRING in metadata_constants.py, enabling workflows to extract them cleanly via MetadataToStringCollectionInvocation / MetadataToStringInvocation.
  • Unified Metadata Label Registry (metadata_constants.py): Consolidated 9 duplicate hand-maintained label sets and literals into a single, type-safe CORE_METADATA_REGISTRY using MetadataType(str, Enum). Eliminates label drift across modules, guarantees * CUSTOM LABEL * as index 0 for UI dropdown defaults, and automatically derives all UI dropdown literals (CORE_LABELS*) and runtime model unwrapping sets (CORE_MODEL_LABELS).
  • Developer & User Documentation:
    • Added "Preserving metadata provenance in modifier nodes" to docs/src/content/docs/development/Guides/creating-nodes.mdx illustrating the model_copy(update={...}) pattern for third-party custom node developers.
    • Updated docs/src/content/docs/development/Architecture/media-metadata.mdx to reflect automatic conditioning metadata extraction and the new positive_prompts / negative_prompts and style prompt schema fields.
    • Added "Metadata and Gallery Recall" pattern to docs/src/content/docs/Users Guide/08.Workflows/editor-reference.mdx explaining Denoise-to-Decode metadata wiring, multi-prompt collections, and workflow metadata recovery via Metadata to String and Metadata to String Collection.
Architectural Roadmap: 3-Stage Metadata Unification

Discussion & Updates: The full stage proposals, architectural discussion, and ongoing progress updates are in the InvokeAI Discord developer forum: Discord Thread.

This PR is Stage 2 of the three-stage initiative:

Related Issues / Discussions

QA Instructions

Automated Verification

  • uv run --no-sync pytest tests/app/invocations/test_conditioning_metadata.py tests/app/invocations/test_denoise_metadata.py tests/app/invocations/test_core_metadata.py (98 passed)
  • uv run --no-sync pytest -n 8 -m "not ffmpeg" tests/app/invocations/ tests/backend/architectures/ tests/app/services/workflow_records/test_default_workflows_registry.py (4,782 passed, 3 skipped)
  • Invocation SemVer & CORE_METADATA_REGISTRY parity audited (46/46 modified invocations bumped, 0 unbumped, 0 version regressions, 138 registry keys OK)
  • uv tool run --offline ruff@0.11.2 check . & format --check . (passed, 2,760 files clean)
  • @invoke-ai/api-contracts: pnpm format:openapi, pnpm typegen, pnpm lint, pnpm test (2/2 passed)
  • Frontend package (invokeai/frontend/webv2): pnpm lint:code (oxfmt, oxlint, lint:tsc), pnpm architecture:check (8 files, 83 passed), and recall/preview Vitest suites (5 files, 997 tests passed)
  • Remote CI (c1356815b5): 30 passed, 3 skipped, 0 failed
  • Live in-app workflow validation across 10 end-to-end scenarios (10/10 PASS, including overlapping regional blends with Image Details rendering)

Live In-App Scenarios Verified (10/10 PASS)

  1. FLUX Multi-Prompt Collection: Two unmasked flux_text_encoder prompts combined via Collect into flux_denoise (joined positive_prompt, raw positive_prompts, no regions, standalone t5_encoder & clip_embed_model).
  2. Krea-2 Modifiers: Chained krea2_conditioning_rebalance -> krea2_seed_variance -> krea2_denoise (krea2_rebalance_*, krea2_seed_variance_*, qwen3_vl_encoder).
  3. Z-Image Seed Variance: z_image_text_encoder -> z_image_seed_variance_enhancer -> z_image_denoise (z_image_seed_variance_*, qwen3_encoder).
  4. SDXL Base & Refiner Multi-Pass: sdxl_compel_prompt -> base denoise_latents -> sdxl_refiner_compel_prompt -> refiner denoise_latents (preserves base prompts, positive_style_prompt/negative_style_prompt, and denoising_start/denoising_end; records refiner_* including refiner_positive_style_prompt / refiner_negative_style_prompt).
  5. Metadata String Collection Extraction: Recovering raw positive_prompts via metadata_to_string_collection.
  6. SD 1.5 Txt2Img: compel positive/negative polarity and clip_skip propagation into denoise_latents.
  7. Wan 2.2 Video (with & without Lightning LoRAs): wan_text_encoder -> wan_video_denoise -> wan_l2v (wan_t5_encoder_model, wan_transformer_low_noise, high/low expert target LoRAs).
  8. FLUX.3 Layout Prompt: flux3_layout_prompt -> flux3_text_encoder -> flux3_denoise (qwen3_vl_encoder, layout caption prompt).
  9. FLUX LoRA Dedup & Regional Masks (All-Masked & Mixed Global+Masked): flux_lora_loader deduplicated across CLIP/T5/transformer; overlapping masked regions rendered cleanly under Regions in Gallery Image Details alongside unmasked global positive_prompt.
  10. Conditioning Primitive & Metadata Linking: compel -> conditioning primitive -> denoise_latents with lora_loader dedup, upstream metadata_item_linked (component_source) passthrough, and metadata_to_string recovery.

Review

  • Verified Invariants: Port-aware polarity assignment, lossless positive_prompts/negative_prompts collection tracking alongside joined unmasked/all-masked summary strings, masked-only regions emission + Image Details camelCase/snake_case display parity, SDXL refiner refiner_*_style_prompt remapping without clobbering base prompts or denoising bounds, safe LoRA deduplication, defensive handling of partial/mocked inputs across unit tests, and full backward compatibility on legacy/custom conditioning edges.
  • Remaining Risks: Live GPU execution covered FLUX, FLUX.3, Krea-2, Z-Image, SDXL (base+refiner), SD1.5, and Wan 2.2 Video; the remaining 10 denoise/encoder families are covered by unit/contract tests (4,782 pytest + 997 frontend recall/preview tests). No regressions observed.

Compatibility / Rollout

  • 100% Backward Compatible: All new fields on *ConditioningField default to None. Existing saved workflows, custom nodes, and cached graph executions run without modification or errors.
  • Pydantic Validation: Nodes creating fresh instances (e.g. ConditioningField(conditioning_name=...)) continue to instantiate cleanly. If a custom node does not use model_copy, downstream denoise nodes gracefully skip prompt metadata without failing.
  • Frontend Recall: Single prompts continue to populate positive_prompt and negative_prompt identically to existing behavior; multi-prompt workflows expose positive_prompts and negative_prompts as collections.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Meaningful regression coverage added / updated where needed; obsolete tests/code removed
  • Persisted-state and API changes include required migrations / compatibility validation
  • Relevant performance/efficiency opportunities considered; material claims have evidence
  • Material review findings resolved and relevant checks rerun
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@github-actions github-actions Bot added python PRs that change python files invocations PRs that change invocations services PRs that change app services python-tests PRs that change python tests documentation PRs that change docs labels Nov 5, 2026
@skunkworxdark

Copy link
Copy Markdown
Contributor Author

Initial Check-in & Status Update (eabd7abf86)

This commit represents the initial implementation check-in for Stage 2: Conditioning, Prompt, and Text Encoder Metadata Propagation.

Prerequisites Before Release from Draft:

  1. Local UI Smoke Testing: Local UI smoke testing across representative model families and workflows (verifying gallery inspection and "Remix / Use All Parameters" recall) needs to be completed.
  2. Stage 1 Acceptance & Merge: This PR is stacked on PR #10083 (Stage 1: Denoise Metadata Unification). Stage 1 must be accepted and merged into main before this PR is rebased and released from Draft status.

Automated Verification Status:

  • Unit Tests: 51/51 passed across test_conditioning_metadata.py, test_denoise_metadata.py, and test_core_metadata.py.
  • Workflow Audit: 8/8 test workflow JSONs passed schema, version, and edge compatibility validation with 0 issues (audit_stage2_workflows.py).
  • Documentation & Linting: Ruff check, Ruff format check, and MDX documentation validation clean across invokeai, tests, and docs.

@skunkworxdark
skunkworxdark force-pushed the feat/conditioning-metadata branch from eabd7ab to 578968a Compare November 7, 2026 16:11
@skunkworxdark

skunkworxdark commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebase & Sync Update (578968a830)

Successfully rebased feat/conditioning-metadata onto the latest Stage 1 (feat/denoise-metadata at cd4f3fbfea, synced with upstream/main at 6d6549ac38):

  • Clean Rebase: Reapplied cleanly with zero git conflicts and zero Stage 2 code changes.
  • Upstream Feature Compatibility: Evaluated upstream additions (HiDiffusion auto-ratio presets fix(hidiffusion): correct ratio presets and denoising transitions #10105, MOSS-Image int8 Qwen3.5 encoder feat(moss-image): load the Qwen3.5 encoder from Comfy-Org's int8 build #10177). All existing Stage 2 conditioning models and extractors remain 100% compatible.
  • Automated Verification:
    • Pytest: 51/51 passed across test_conditioning_metadata.py (25), test_denoise_metadata.py (24), and test_core_metadata.py (2).
    • Workflow Audit: 8/8 test workflows passed schema and version audits with 0 issues (audit_stage2_workflows.py).
    • Linter & Formatting: ruff check, ruff format --check, and OpenAPI contract Prettier checks all green.
  • PR Status: Remains in Draft pending local smoke testing and Stage 1 acceptance/merge.

@skunkworxdark
skunkworxdark force-pushed the feat/conditioning-metadata branch from 578968a to 05cf76f Compare November 7, 2026 23:17
@skunkworxdark

skunkworxdark commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebase & Sync Update (05cf76f4a9)

Successfully rebased feat/conditioning-metadata onto the latest Stage 1 (feat/denoise-metadata at commit 88a13f698d):

  • Integrated Stage 1 Review Fixes:
    • Preserved IP-Adapter weight schedules and mask round-trips without flattening.
    • Excluded FLUX Control LoRA from regular LoRAs metadata.
    • Integrated authoritative execution isolation for denoise-local execution lists (loras, controlnets, t2iAdapters, ref_images).
    • Incorporated node semver bumps: denoise_latents (1.9.0), anima_denoise (1.10.0), krea2_denoise (1.5.0), and flux3_denoise (1.1.0).
  • Stage 2 Cross-Check & Alignment:
    • Invocation SemVers audited against upstream main: 0 regressions, 21 bumps, 79 matching versions.
    • All schedule and string list collections preserved without flattening.
    • Test workflows regenerated and validated against bumped node schemas.
  • Verification Gates:
    • Pytest: 58/58 passed across test_conditioning_metadata.py (25), test_denoise_metadata.py (31), and test_core_metadata.py (2).
    • Workflow Audit: 8/8 test workflows passed with 0 issues (audit_stage2_workflows.py).
    • Linter & Formatting: ruff check, ruff format --check, and OpenAPI contract Prettier checks all clean.
  • PR Status: Remains in Draft pending local smoke testing and Stage 1 acceptance/merge.

@lstein lstein added the 7.1.0 label Nov 8, 2026
@lstein lstein moved this to 7.1.0: new features in Invoke - Community Roadmap Nov 8, 2026
@skunkworxdark
skunkworxdark force-pushed the feat/conditioning-metadata branch from 05cf76f to c5cefae Compare November 8, 2026 19:13
@skunkworxdark

Copy link
Copy Markdown
Contributor Author

Rebase & Sync Update (c5cefaeae7)

Successfully rebased feat/conditioning-metadata onto the latest Stage 1 (feat/denoise-metadata at commit f2fb9f995c):

  • Integrated Stage 1 Round 2 Review Fixes:
    • Empty list retention ([]) so denoise updates explicitly clear upstream metadata rather than falling back to stale legacy data.
    • Authoritative execution isolation across all 19 denoise nodes (unconditional list updates).
    • Preserved IPAdapterField.mask contract at Optional[TensorField].
    • Core model label discrimination in unwrap_metadata_value ensuring model and VAE recall keys are properly unwrapped.
    • Anima inpaint adapter selection filtering for populated mask names.
  • Stage 2 Cross-Check & Independent Proposal Review:
    • Audited stage2-conditioning-metadata-proposal.md against latest Round 2 invariants (empty list retention, authoritative isolation, model unwrapping).
    • Zero SemVer regressions across all invocation nodes vs upstream main.
    • Schedule and collection lists preserved without flattening.
    • Test workflows verified: 8/8 test workflows pass schema and version audit.
  • Verification Gates:
    • Pytest: 67/67 passed across test_conditioning_metadata.py (25), test_denoise_metadata.py (40), and test_core_metadata.py (2).
    • Workflow Audit: 8/8 test workflows passed with 0 issues (audit_stage2_workflows.py).
    • Linter & Formatting: ruff check, ruff format --check, and OpenAPI contract Prettier checks all clean.
  • PR Status: Remains in Draft pending local smoke testing and Stage 1 acceptance/merge.

@skunkworxdark
skunkworxdark force-pushed the feat/conditioning-metadata branch from c5cefae to 088f416 Compare November 8, 2026 19:49
@skunkworxdark

Copy link
Copy Markdown
Contributor Author

Rebase & Upstream Sync Update

Branch feat/conditioning-metadata has been rebased onto the latest feat/denoise-metadata (Stage 1 base at commit ddda47c1d8), integrating 32 upstream commits from invoke-ai:main.

Audit & Integration Summary:

  • Documentation Integration: Resolved conflict in docs/src/content/docs/development/Guides/creating-nodes.mdx, keeping both the modifier metadata provenance guide and upstream's node pack listing guide.
  • Upstream Text Encoder & Submodel Audits: Verified text encoder LoRA provenance propagation for SD3 and Ideogram 4; confirmed upstream vision_tower and connectors model unwrapping works cleanly with conditioning metadata extraction.
  • SemVer Integrity: Audited all invocation versions against upstream main — 0 regressions across all nodes.
  • Workflow & Schema Verification: 8/8 Stage 2 test workflows verified against current schemas with zero discrepancies.

Test Gates:

  • Unit Tests: 67/67 passing (test_conditioning_metadata.py, test_denoise_metadata.py, test_core_metadata.py)
  • Workflow Audit: 8/8 workflows passing audit (audit_stage2_workflows.py)
  • Code Quality: Ruff check clean, Ruff format check clean (2,560 files)
  • Frontend Contracts: pnpm lint and pnpm test passing in invokeai/frontend/api

@skunkworxdark
skunkworxdark force-pushed the feat/conditioning-metadata branch from 088f416 to 33e2891 Compare November 8, 2026 21:04
@github-actions github-actions Bot added the backend PRs that change backend files label Nov 8, 2026
@skunkworxdark
skunkworxdark force-pushed the feat/conditioning-metadata branch 2 times, most recently from 3e7f33f to b8fb814 Compare November 8, 2026 22:32
@skunkworxdark

Copy link
Copy Markdown
Contributor Author

Review Parity & Defensive Audit Fixes Update

Branch feat/conditioning-metadata has been updated at commit b8fb814131 with lessons learned from Stage 1 maintainer reviews and upstream main syncs:

Audit Fixes Summary:

  • Stale Collection & Regional Cleanup: In build_denoise_metadata(), when transitioning from multi-prompt / regional workflows to single-prompt / non-regional workflows, stale positive_prompts, negative_prompts, and regions from upstream metadata are cleanly removed so metadata accurately reflects single-prompt executions.
  • Core Text Encoder Label Unwrapping: Expanded CORE_MODEL_LABELS in metadata.py with standalone text encoders (wan_t5_encoder_model, qwen_vl_encoder, qwen_image_qwen_vl_encoder, ltx2_text_encoder_model, minimax_h3_text_encoder_model, glm_encoder) to ensure unwrap_metadata_value() always unwraps them to inner ModelIdentifierField for frontend model key recall.
  • Defensive Extraction Safety: Safely extracts models and text encoder LoRAs (extract_encoder_model, extract_loras_metadata), tolerating unit test mocks and non-model objects.

Test Gates:

  • Subsystem & Regression Tests: 353/353 passing across conditioning metadata, denoise metadata, offload device suites, and backend architecture modality facets.
  • Workflow Audit: 8/8 Stage 2 test workflows passing (audit_stage2_workflows.py).
  • Code Quality: Ruff check clean, Ruff format check clean (2,560 files).
  • Frontend Contracts: Prettier check and typegen contracts passing in invokeai/frontend/api.

@skunkworxdark

Copy link
Copy Markdown
Contributor Author

Stage 2 Update: Centralized Metadata Label Registry (metadata_constants.py)

Pushed commit 81df4657f5 to feat/conditioning-metadata centralizing all metadata label definitions and typed UI literals into a single source of truth:

  1. Unified Registry: Replaced 9 duplicate hand-maintained label collections across metadata.py and metadata_linked.py with CORE_METADATA_REGISTRY in invokeai/app/invocations/metadata_constants.py using MetadataType(str, Enum).
  2. Drift Harmonization: Resolved missing standalone models across files (e.g. glm_encoder, qwen_vl_encoder, ideogram4_unconditional_model, wan_transformer_low_noise).
  3. Ordering Invariants: Guaranteed * CUSTOM LABEL * is pinned at index 0 across all derived literals and OpenAPI JSON schema enums for UI defaults, while preserving intentional human-curated dropdown priority.
  4. Backward Compatibility: All derived constants and literals are re-exported from metadata.py and metadata_linked.py.
  5. Contract Synchronization: Regenerated openapi.json and schema.ts; Prettier formatting and TypeScript typegen tests passing.
  6. Architectural Policy & Docs: Updated invokeai/app/AGENTS.md, new-model-integration.mdx, and media-metadata.mdx.
  7. Verification Gates:
    • Subsystem unit test suite: 4,466 tests passed.
    • Stage 2 test workflows audit: 8/8 workflows PASS with 0 issues.
    • Frontend image recall: 202/202 tests passed (imageRecall.test.ts).
    • Linter & formatting: Ruff clean across 2,561 files.
    • PR metadata conformance: check_pr_metadata.py verified.
    • Independent code review: VERIFIED PASS.

@skunkworxdark
skunkworxdark force-pushed the feat/conditioning-metadata branch from 81df465 to 085295b Compare November 12, 2026 20:00
@skunkworxdark

Copy link
Copy Markdown
Contributor Author

Rebase & Sync Update (085295b78b)

Successfully rebased feat/conditioning-metadata onto the latest Stage 1 (feat/denoise-metadata at commit d8c6264d22, which merged 22 upstream commits from upstream/main and resolved maintainer review Round 3):

  • Integrated Stage 1 Review Round 3 & Upstream Features:
    • Ingested backported canonical metadata_constants.py defining CORE_METADATA_REGISTRY, MetadataType, and derived literals.
    • Ingested upstream additions from PR 9822 (ERNIE-Image LoRAs) and PR 10220 (image and video recall contract tests).
    • Registered flux3_prompt_upsampler (T.MODEL) under # Flux in CORE_METADATA_REGISTRY per upstream PR 10219 (FLUX.3 prompt upsampler).
    • Regenerated OpenAPI schema (openapi.json) and TypeScript contracts (schema.ts).
  • Verification Gates (all green):
    • Subsystem & Architecture Unit Tests: 4,443 passed (pytest -n 4 tests/app/invocations/ tests/backend/architectures/).
    • Metadata Unit Tests: 76/76 passed (test_core_metadata.py, test_denoise_metadata.py, test_conditioning_metadata.py).
    • Default Workflows Registry: 85/85 passed (test_default_workflows_registry.py).
    • Stage 2 Workflows Audit: 8/8 passed with 0 issues (audit_workflows.py).
    • Frontend Recall Contracts: 943/943 passed (imageRecall.test.ts, imageRecallContract.test.ts, videoRecallContract.test.ts in invokeai/frontend/webv2).
    • Code Quality: Ruff check & format clean across 2,591 files; oxlint clean across 2,927 files; Prettier clean in invokeai/frontend/api.
    • PR Metadata Conformance: Verified via check_pr_metadata.py.
  • PR Status: Remains in Draft pending Stage 1 acceptance and merge.

@skunkworxdark

Copy link
Copy Markdown
Contributor Author

Registry Completeness & Type-Safety Update (5ee9a6244d)

Addressed 4 non-blocking findings identified during an independent audit of CORE_METADATA_REGISTRY:

  • Registry Additions (metadata_constants.py):
    • Added ("anima_inpaint_adapter", T.MODEL) and ("anima_inpaint_adapter_weight", T.FLOAT) under # Anima (used by anima_denoise.py and frontend image recall).
    • Added ("qwen3_vl_vision_tower", T.MODEL) under encoder submodels (used by Qwen-Image-2.1 graphs and frontend image recall).
    • Added ("component_source", T.MODEL) under # Qwen Image (matching QwenImageConditioningField.component_source).
  • Explicit Re-exports (metadata_linked.py):
    • Updated CORE_LABELS* imports from metadata_constants.py to explicit Symbol as Symbol PEP 484 re-export syntax for strict static type checkers.
  • OpenAPI & TypeScript Contracts:
    • Regenerated openapi.json and schema.ts and verified Prettier lint and typegen contract tests.
  • Regression Coverage (test_core_metadata.py):
    • Added behavioral tests verifying unwrap_metadata_value() unwraps the newly registered model labels (while preserving custom wrappers/LoRAs) and MetadataTo* / MetadataItemLinkedInvocation validate them cleanly.
  • Verification Gates:
    • Subsystem test suite: 4,445 passed (pytest -n 4 tests/app/invocations/ tests/backend/architectures/).
    • Metadata unit tests: 78/78 passed (test_core_metadata.py, test_denoise_metadata.py, test_conditioning_metadata.py).
    • Default workflows registry: 85/85 passed.
    • Stage 2 test workflows audit: 8/8 passed with 0 issues.
    • Frontend recall contracts: 943/943 passed (imageRecall.test.ts, imageRecallContract.test.ts, videoRecallContract.test.ts).
    • Ruff & oxlint: clean across all files.

@skunkworxdark

Copy link
Copy Markdown
Contributor Author

Rebased Stage 2 (feat/conditioning-metadata -> b8b6d1c741) onto Stage 1 origin/feat/denoise-metadata (214cd77b24, after all 20 remote CI checks on PR 10083 passed).

Rebase Summary

  1. Dropped redundant Stage 2 registry/typing hunks (anima_inpaint_adapter, anima_inpaint_adapter_weight, qwen3_vl_vision_tower, flux3_prompt_upsampler, and PEP 484 metadata_linked.py re-exports) now ingested cleanly from Stage 1 (214cd77b24).
  2. Retained Stage 2-exclusive component_source (T.MODEL) in CORE_METADATA_REGISTRY (metadata_constants.py) alongside conditioning metadata propagation and component_source behavioral assertions merged into test_core_metadata.py.
  3. Regenerated openapi.json and schema.ts.

Local Verification (b8b6d1c741)

  • Subsystem & Architecture Tests: 4,445 passed, 4 skipped, 4 xfailed (pytest -n 4 -m "not ffmpeg" tests/app/invocations/ tests/backend/architectures/)
  • Focused Unit + Modality + Workflow Registry Tests: 170 passed (test_core_metadata.py 8, test_denoise_metadata.py 41, test_conditioning_metadata.py 29, test_modality.py 7, test_default_workflows_registry.py 85)
  • Stage 2 Test Workflows: 8/8 PASS (audit_workflows.py)
  • Frontend API & Recall Contracts: 2/2 contract generator tests + Prettier clean (invokeai/frontend/api); 943 passed across recall + contract suites + 0 warnings / 0 errors across 2,927 files in oxlint (invokeai/frontend/webv2)
  • Ruff & PR Metadata: All checks passed!, 2591 files already formatted, check_pr_metadata.py clean

@skunkworxdark
skunkworxdark force-pushed the feat/conditioning-metadata branch from 5ee9a62 to b8b6d1c Compare November 12, 2026 22:27
@skunkworxdark

Copy link
Copy Markdown
Contributor Author

Rebased Stage 2 (feat/conditioning-metadata -> 1ddb7c80c5) onto Stage 1 origin/feat/denoise-metadata (183ed54741, after all 20 remote CI checks on PR 10083 passed).

Rebase Summary

  1. Ingested Stage 1's 31-commit upstream/main sync (including MOSS-Image LoRAs PR 10271 and Krea-2 GGUF mmproj PR 10244) plus Round 4 review fixes (cfg_scale schedule support, Wan LoRA target/low_noise_weight, hidiffusion_auto_ratios, and denoise/core_metadata version bumps).
  2. Aligned canonical LoRAMetadataField in fields.py with target and low_noise_weight, preserved dict- and expert-aware deduplication in serialize_lora_metadata() alongside serialize_wan_lora_metadata(), kept Stage 2-exclusive component_source (T.MODEL) in CORE_METADATA_REGISTRY, and restored extract_conditioning_metadata() documentation in media-metadata.mdx.
  3. Regenerated openapi.json and schema.ts.

Local Verification (1ddb7c80c5)

  • Subsystem & Architecture Tests: 4,509 passed, 7 skipped, 4 xfailed (pytest -n 4 -m "not ffmpeg" tests/app/invocations/ tests/backend/architectures/)
  • Focused Unit, Node Types, Workflow Registry & Modality Tests: 1,245 passed, 3 skipped (test_default_workflows_registry.py, test_core_metadata.py, test_denoise_metadata.py, test_conditioning_metadata.py, test_frontend_graph_node_types.py, test_modality.py)
  • Stage 2 Test Workflows: 8/8 PASS (audit_workflows.py)
  • Frontend API & Recall Contracts: 2/2 contract generator tests + Prettier clean (invokeai/frontend/api); 958 passed across recall + contract suites + 0 warnings / 0 errors across 3,023 files in oxlint (invokeai/frontend/webv2)
  • Ruff & PR Metadata: All checks passed!, 2,635 files already formatted, check_pr_metadata.py clean

@skunkworxdark
skunkworxdark force-pushed the feat/conditioning-metadata branch from b8b6d1c to 1ddb7c8 Compare November 17, 2026 21:44
@github-actions github-actions Bot added the frontend PRs that change frontend files label Nov 17, 2026
@skunkworxdark

Copy link
Copy Markdown
Contributor Author

Rebased Stage 2 (feat/conditioning-metadata -> f322e7bc8f, 0 conflicts) onto Stage 1 origin/feat/denoise-metadata (2da7614b08).

Rebase Summary

  1. Ingested Stage 1 Round 5 review fixes (ERNIE-Image txt2img-only capability parity, custom-label non-LoRA wrapper preservation in unwrap_metadata_value(), Wan LoRA target/lowNoiseWeight UI controls) plus 6 upstream/main commits.
  2. Verified ERNIE-Image txt2img-only (ernie_image_img2img absent from GENERATION_MODES) and wrapper-preservation invariants alongside Stage 2 conditioning metadata propagation and Stage 2-exclusive component_source.

Local Verification (f322e7bc8f)

  • Subsystem & Architecture Tests: 4,511 passed, 7 skipped, 4 xfailed (pytest -n 4 -m "not ffmpeg" tests/app/invocations/ tests/backend/architectures/)
  • Focused Unit, Node Types, Workflow Registry & Modality Tests: 1,247 passed, 3 skipped (test_default_workflows_registry.py, test_core_metadata.py, test_denoise_metadata.py, test_conditioning_metadata.py, test_frontend_graph_node_types.py, test_modality.py)
  • Stage 2 Test Workflows: 8/8 PASS (audit_workflows.py)
  • Frontend API & Recall Contracts: 2/2 contract generator tests + Prettier clean (invokeai/frontend/api); 958 passed across recall + contract suites + 0 warnings / 0 errors across 3,028 files in oxlint (invokeai/frontend/webv2)
  • Ruff & PR Metadata: All checks passed!, 2,635 files already formatted, check_pr_metadata.py clean

@skunkworxdark
skunkworxdark force-pushed the feat/conditioning-metadata branch 2 times, most recently from f322e7b to b54e65e Compare November 18, 2026 21:55
@skunkworxdark

skunkworxdark commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Synced feat/conditioning-metadata onto Stage 1 (feat/denoise-metadata @ 9e7614bce6, commit b54e65ee11):

  • Preserved Stage 1 Round 6 fixes (CORE_LABELS_MAIN_MODEL / CORE_LABELS_SDXL_MODEL label narrowing, extract_model_key ModelType validation, ti2v_5b Wan LoRA guards, and Round 6 metadata node version bumps) alongside Stage 2 component_source and conditioning metadata propagation.
  • Regenerated openapi.json and schema.ts (@invoke-ai/api-contracts pnpm lint and pnpm test 2/2 passed).
  • Verified ruff check / ruff format --check (2,635 files), focused metadata/registry suite (1,249 passed, 3 skipped), tests/app/invocations/ + tests/backend/architectures/ (4,513 passed, 7 skipped, 4 xfailed), webv2 format:check / lint:oxc / targeted recall tests (5 files, 1,004 passed), and Stage 2 test workflow audit (8/8 PASS).

…data upstream

Add optional metadata fields to conditioning classes and populate them across 18 text encoder invocations.
Preserve provenance in conditioning modifiers using model_copy and extract in denoise invocations.
Support multi-prompt collection extraction and document modifier provenance guidelines.
…gistry

Register Stage 2-exclusive component_source key (QwenImageConditioningField.component_source) in CORE_METADATA_REGISTRY, regenerate API contracts, and add Stage 2 coverage in test_core_metadata.py.
…age 1

Add Stage 1 Wan LoRA target and low_noise_weight fields to canonical LoRAMetadataField in fields.py, remove duplicate definition in metadata.py while preserving re-export, regenerate API contracts, and restore extract_conditioning_metadata() documentation in media-metadata.mdx.
@skunkworxdark
skunkworxdark force-pushed the feat/conditioning-metadata branch from b54e65e to 9d5592c Compare November 19, 2026 20:45
@github-actions github-actions Bot added the docs label Nov 28, 2026
@skunkworxdark

Copy link
Copy Markdown
Contributor Author

Synced feat/conditioning-metadata with upstream/main (62 commits through f97d7470bf) at 599b1a2aac:

  • Metadata Parity & Sanity Check Across Upstream Changes:
    • Verified all 19 base denoise invocations retain Stage 1 + Stage 2 _build_metadata() parity (CORE_METADATA_REGISTRY: 132 keys; frontend/webv2 generation/core/graph.ts, upscale/core/graph.ts, video/core/graph.ts all aligned).
    • Verified Ideogram4DenoiseInvocation._build_metadata() emits effective cfg_scale and steps matching PR 10224, and verified Krea2ControlLoRAInvocation / Krea2DenoiseInvocation.control_lora (PR 10332) remains excluded from loras.
    • Bumped krea2_denoise from 1.6.0 to 1.7.0 (resolving upstream's 1.5.0 -> 1.6.0 bump collision from PR 10332) and regenerated openapi.json (audit_invocations.py: 44 bumped, 0 unbumped).
  • Local Verification:
    • ruff check . & ruff format --check . (2,753 files): pass.
    • @invoke-ai/api-contracts: pnpm lint & pnpm test (2/2 pass).
    • Stage 2 workflow audit: 8/8 PASS (updated 02_krea2_rebalance_and_seed_variance_metadata.json for control_lora + krea2_denoise 1.7.0).
    • Focused pytest (default workflows, core/denoise/conditioning metadata, frontend node types, modality, Krea-2 Control LoRA graphs): 1,293 passed, 3 skipped.
    • Full tests/app/invocations/ + tests/backend/architectures/: 4,779 passed, 7 skipped.
    • webv2 format:check (3,139 files), lint:oxc (3,056 files, 0 warnings/errors), targeted recall tests (5 files, 925 passed).

@skunkworxdark

Copy link
Copy Markdown
Contributor Author

Stage 2 is ready for review on PR 10172 (head c1356815b5, rebased/merged atop upstream/main edd3939d0a).

Handover Summary (Since Prior Sync Update)

  1. Upstream Sync & PR 10280 / PR 10290 Parity:

    • Merged upstream/main (a33a64ae36 -> edd3939d0a), preserving CORE_METADATA_VERSION = "1.4.0", core_metadata 2.11.0, mistral_source, vae_precision, color_compensation, tile_controlnet, Krea-2 working memory (krea2_denoise 1.7.0), and strict bundled workflow field validation (test_default_workflows_registry.py).
    • Updated openapi.json, schema.ts, media-metadata.mdx, and bumped metadata_to_string & metadata_to_string_collection (1.1.0 -> 1.2.0) for CORE_LABELS_STRING additions.
  2. Multi-Prompt & Regional Metadata Behavior (extract_conditioning_metadata() + Image Details):

    • Multiple global (mask=None) prompts (Collect): Joins non-empty unmasked prompts with ", " into positive_prompt / negative_prompt without emitting spurious regions, while keeping raw prompt lists in positive_prompts / negative_prompts.
    • Mixed global + masked regions: positive_prompt keeps only the unmasked global prompt(s); regions emits strictly masked entries (mask is not None, matching Canvas conventions so unmasked globals do not duplicate in regions); positive_prompts keeps every collected prompt in order.
    • All-masked collections (no unmasked global prompt): Joins all non-empty prompts with ", " as a complete summary fallback while preserving per-region entries in regions and positive_prompts.
    • Gallery Image Details fallback (previewMetadata.ts): Added positivePrompt ?? positive_prompt fallback so Image Details renders both Canvas camelCase regions and backend snake_case regions cleanly.
  3. SDXL Base -> Refiner Multi-Pass Preservation (denoise_latents.py & metadata_constants.py):

    • When StableDiffusionXLRefiner runs downstream of a base SDXL pass, base denoising_start, denoising_end, positive_prompt, negative_prompt, positive_style_prompt, and negative_style_prompt stay intact.
    • Refiner .style conditioning text maps to refiner_positive_style_prompt / refiner_negative_style_prompt (registered in CORE_METADATA_REGISTRY as T.STRING).

Verification

  • Remote CI (c1356815b5): 30 passed, 3 skipped, 0 failed (MERGEABLE).
  • Pytest (tests/app/invocations/, tests/backend/architectures/, test_default_workflows_registry.py): 4,782 passed, 3 skipped (98 passed across test_conditioning_metadata.py, test_denoise_metadata.py, test_core_metadata.py).
  • Ruff (check . & format --check .): clean across 2,760 files.
  • API & Frontend Checks: @invoke-ai/api-contracts (format:openapi, typegen, lint, 2/2 tests passed); invokeai/frontend/webv2 lint:code, architecture:check (8 files, 83 passed), and recall/preview Vitest suites (5 files, 997 passed).
  • Live In-App Verification: All 10 end-to-end Stage 2 scenarios verified live on GPU (covering FLUX, FLUX.3, Krea-2, Z-Image, SDXL Base+Refiner, SD 1.5, Wan 2.2 Video with/without targeted Lightning LoRAs, overlapping regional mask blends + Image Details UI, and metadata_item_linked / metadata_to_string* round-trip extraction). Note: remaining 10 model families (Anima, CogView4, ERNIE-Image, FLUX.2, Ideogram 4, LTX-2, MiniMax H3, MOSS-Image, Qwen-Image/2.1, SD3) are verified via unit/contract tests.

@skunkworxdark
skunkworxdark marked this pull request as ready for review November 30, 2026 09:28
…etadata

# Conflicts:
#	invokeai/app/invocations/ideogram4/ideogram4_denoise.py
#	invokeai/app/invocations/qwen_image/qwen_image_denoise.py
#	invokeai/app/invocations/sd3/sd3_denoise.py
#	invokeai/app/invocations/z_image/z_image_denoise.py
#	invokeai/frontend/api/openapi.json

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

7.1.0 backend PRs that change backend files docs documentation PRs that change docs frontend PRs that change frontend files invocations PRs that change invocations python PRs that change python files python-tests PRs that change python tests services PRs that change app services

Projects

Status: 7.1.0: new features

Development

Successfully merging this pull request may close these issues.

3 participants