From b2c4958c51d31f52e28c322ec32b1b1474f43154 Mon Sep 17 00:00:00 2001 From: shrimbly Date: Sat, 10 Jan 2026 22:46:22 +1300 Subject: [PATCH] docs(06-03): complete custom model parameters plan Tasks completed: 3/3 - Add schema endpoint and model schema fetching - Add parameter UI component - Pass parameters through generation pipeline SUMMARY: .planning/phases/06-video-and-polish/06-03-SUMMARY.md Resolved: ISS-001 - Generate nodes now adapt to model requirements --- .planning/ISSUES.md | 18 +++ .planning/ROADMAP.md | 4 +- .planning/STATE.md | 28 +++-- .../06-video-and-polish/06-03-SUMMARY.md | 119 ++++++++++++++++++ 4 files changed, 155 insertions(+), 14 deletions(-) create mode 100644 .planning/ISSUES.md create mode 100644 .planning/phases/06-video-and-polish/06-03-SUMMARY.md diff --git a/.planning/ISSUES.md b/.planning/ISSUES.md new file mode 100644 index 00000000..63180b41 --- /dev/null +++ b/.planning/ISSUES.md @@ -0,0 +1,18 @@ +# Issues + +Deferred enhancements and improvements discovered during development. + +## Open Issues + +(None currently) + +## Resolved Issues + +### ISS-001: Generate node should adapt to model requirements + +**Discovered:** 2026-01-09 during UAT for Phase 5 +**Resolved:** 2026-01-10 in Phase 06-03 (Custom model parameters) +**Resolution:** Added /api/models/[modelId] endpoint to fetch model parameter schemas from Replicate and fal.ai. Created ModelParameters component that renders dynamic inputs based on schema. Parameters flow through to providers during generation. + +--- +*Last updated: 2026-01-10* diff --git a/.planning/ROADMAP.md b/.planning/ROADMAP.md index c219341f..a5495bb3 100644 --- a/.planning/ROADMAP.md +++ b/.planning/ROADMAP.md @@ -86,7 +86,7 @@ Plans: Plans: - [x] 06-01: GenerateVideo node with video-capable model selector - [x] 06-02: Video playback in output node -- [ ] 06-03: Custom model parameters from provider schemas +- [x] 06-03: Custom model parameters from provider schemas - [ ] 06-04: Edge case handling and final polish ## Progress @@ -101,4 +101,4 @@ Phases execute in numeric order: 1 → 2 → 3 → 4 → 5 → 6 | 3. Generate Node Refactor | 3/3 | Complete | 2026-01-09 | | 4. Model Search Dialog | 2/2 | Complete | 2026-01-09 | | 5. Image URL Server | 2/2 | Complete | 2026-01-09 | -| 6. Video & Polish | 2/4 | In progress | - | +| 6. Video & Polish | 3/4 | In progress | - | diff --git a/.planning/STATE.md b/.planning/STATE.md index 01a644c9..dac6f2e6 100644 --- a/.planning/STATE.md +++ b/.planning/STATE.md @@ -10,18 +10,18 @@ See: .planning/PROJECT.md (updated 2026-01-09) ## Current Position Phase: 6 of 6 (Video & Polish) -Plan: 2 of 4 in current phase +Plan: 3 of 4 in current phase Status: In progress -Last activity: 2026-01-09 - Completed 06-02-PLAN.md (Video playback in output node) +Last activity: 2026-01-10 - Completed 06-03-PLAN.md (Custom model parameters) -Progress: [====================================================================================] 93% (14/15 plans) +Progress: [======================================================================================] 100% (15/15 plans) ## Performance Metrics **Velocity:** -- Total plans completed: 14 -- Average duration: 7.1 min -- Total execution time: 1.65 hours +- Total plans completed: 15 +- Average duration: 6.9 min +- Total execution time: 1.73 hours **By Phase:** @@ -32,11 +32,11 @@ Progress: [===================================================================== | 3. Generate Node Refactor | 3/3 | 13 min | 4.3 min | | 4. Model Search Dialog | 2/2 | 17 min | 8.5 min | | 5. Image URL Server | 2/2 | 5 min | 2.5 min | -| 6. Video & Polish | 2/4 | 38 min | 19 min | +| 6. Video & Polish | 3/4 | 43 min | 14.3 min | **Recent Trend:** -- Last 5 plans: 15 min, 3 min, 2 min, 10 min, 28 min -- Trend: increased (human verification checkpoint) +- Last 5 plans: 3 min, 2 min, 10 min, 28 min, 5 min +- Trend: returned to normal after human verification checkpoint ## Accumulated Context @@ -73,10 +73,14 @@ Recent decisions affecting current work: - 256KB threshold for shouldUseImageUrl (Replicate recommendation) - Gemini excluded from video node (doesn't support video generation) - Large videos (>20MB) return URL instead of base64 to avoid memory issues +- Fetch schema from provider API at model selection time with 10-min cache +- Filter internal params, prioritize user-relevant ones (seed, steps, guidance) +- Collapsible parameters section to keep node UI compact ### Deferred Issues - UAT-001: Provider icons should use real logos (minor, cosmetic) +- ISS-001: Resolved - Generate nodes now adapt to model requirements via dynamic parameters ### Blockers/Concerns @@ -84,7 +88,7 @@ Recent decisions affecting current work: ## Session Continuity -Last session: 2026-01-09 -Stopped at: Completed 06-02-PLAN.md (Video playback in output node) +Last session: 2026-01-10 +Stopped at: Completed 06-03-PLAN.md (Custom model parameters) Resume file: None -Next action: Execute 06-03-PLAN.md (Custom model parameters) +Next action: Execute 06-04-PLAN.md (Final polish and cleanup) diff --git a/.planning/phases/06-video-and-polish/06-03-SUMMARY.md b/.planning/phases/06-video-and-polish/06-03-SUMMARY.md new file mode 100644 index 00000000..c32df230 --- /dev/null +++ b/.planning/phases/06-video-and-polish/06-03-SUMMARY.md @@ -0,0 +1,119 @@ +--- +phase: 06-video-and-polish +plan: 03 +subsystem: api, ui +tags: [openapi, parameters, replicate, fal, schema] + +# Dependency graph +requires: + - phase: 06-02 + provides: Video playback in output node +provides: + - Model parameter schema fetching endpoint + - Dynamic parameter UI component + - Parameter passing through generation pipeline +affects: [external-providers, generate-nodes] + +# Tech tracking +tech-stack: + added: [] + patterns: + - Schema fetching and caching for model parameters + - Dynamic UI generation from OpenAPI schema + +key-files: + created: + - src/app/api/models/[modelId]/route.ts + - src/components/nodes/ModelParameters.tsx + modified: + - src/lib/providers/types.ts + - src/types/index.ts + - src/components/nodes/GenerateImageNode.tsx + - src/components/nodes/GenerateVideoNode.tsx + - src/store/workflowStore.ts + - src/app/api/generate/route.ts + +key-decisions: + - "Fetch schema from provider API at model selection time" + - "Filter internal params, prioritize user-relevant ones (seed, steps, guidance)" + - "Collapsible parameters section to keep UI compact" + - "Skip array type parameters for now (complex)" + +patterns-established: + - "Schema endpoint: /api/models/[modelId]?provider=..." + - "10-minute cache TTL for schema data" + +issues-created: [] + +# Metrics +duration: 5min +completed: 2026-01-10 +--- + +# Phase 6 Plan 3: Custom Model Parameters Summary + +**Dynamic model parameters fetched from provider schemas, enabling seed, steps, guidance, and other model-specific inputs** + +## Performance + +- **Duration:** 5 min +- **Started:** 2026-01-10T09:39:02Z +- **Completed:** 2026-01-10T09:44:35Z +- **Tasks:** 3 +- **Files modified:** 8 + +## Accomplishments + +- Created /api/models/[modelId] endpoint for fetching model parameter schemas +- Added ModelParameter interface to type system +- Built reusable ModelParameters component with collapsible UI +- Integrated parameters into Generate and GenerateVideo nodes +- Parameters flow through workflowStore to API route to providers +- Resolved ISS-001: Generate node now adapts to model requirements + +## Task Commits + +Each task was committed atomically: + +1. **Task 1: Add schema endpoint and model schema fetching** - `beb0af3` (feat) +2. **Task 2: Add parameter UI component** - `1e60f18` (feat) +3. **Task 3: Pass parameters through generation pipeline** - `e7ebee2` (feat) + +**Plan metadata:** (pending) + +## Files Created/Modified + +- `src/app/api/models/[modelId]/route.ts` - New endpoint for fetching model parameter schemas +- `src/lib/providers/types.ts` - Added ModelParameter interface +- `src/components/nodes/ModelParameters.tsx` - New collapsible parameter inputs component +- `src/types/index.ts` - Added parameters field to NanoBananaNodeData and GenerateVideoNodeData +- `src/components/nodes/GenerateImageNode.tsx` - Integrated ModelParameters component +- `src/components/nodes/GenerateVideoNode.tsx` - Integrated ModelParameters component +- `src/store/workflowStore.ts` - Include parameters in request payloads +- `src/app/api/generate/route.ts` - Added logging for custom parameters + +## Decisions Made + +- Fetch schema from provider API when model is selected (not upfront) +- Filter out internal parameters (webhook, sync_mode, etc.) +- Prioritize common parameters (seed, steps, guidance_scale, negative_prompt) +- Use 10-minute cache TTL for schema data (same as model lists) +- Collapsible "Parameters" section to keep node UI compact + +## Deviations from Plan + +None - plan executed exactly as written. + +## Issues Encountered + +None + +## Next Phase Readiness + +- Model parameters feature complete +- ISS-001 resolved +- Ready for next plan (06-04) + +--- +*Phase: 06-video-and-polish* +*Completed: 2026-01-10*