Describe... board generation (#44) #95

Merged
crowmaki merged 2 commits from issue-44-describe-board into main 2026-10-08 09:01:04 +00:00
Owner

Closes #44.

A filmmaker can fill a Panel's Sketch layer from a description instead of drawing it (User Stories 86 and 87).

What changed

  • Schema v16. A job now targets a Reference version or a Panel. A describe job records its prompt, seed, tone choice and target canvas. A Panel stores what it was last described as.
  • describe_panel queues image.board at about 1 MP at the ratio of the Shot's canvas. When the image lands, Rust scales it to fill the canvas (cropping any overflow) and can reduce it to ink, grey and paper. It goes into the Sketch layer as one undoable "Describe panel" edit. Annotations are kept.
  • regenerate_panel queues the stored prompt and tone choice again with a new seed. Board saves keep a Panel's description.
  • Board view. Adds a "Describe…" button (its dialog has a "Reduce to 3 tones" checkbox), a "Regenerate" button, and a badge for the Panel's queued, running or failed job. Before it queues, Describe saves the Board, so the Panel has an id.
  • Queue entries are labelled 1A · Panel 1. JobDto now has an optional target, either a Tile version or a Shot and Panel.

Decisions worth a look

  • Undo entry from the worker. Queuing is append-only. The Sketch the job brings back is an undoable edit, as #44 asks. The worker performs that edit when the image lands, so the undo entry appears then, and it clears redo. undo.rs now documents this exception.
  • Panels deleted while a job waits. A Board save rewrites its Panels' rows, so job.panel_id has no foreign key. While its Panel is gone, a job is hidden from the queue and does not run. Undo brings both back.
  • Barred Panels. A barred Panel is described onto the Shot's current canvas. This counts as drawing on it again, so it is no longer barred. The CONTEXT.md Panel entry says so.
  • Failed first Describe. A first Describe… that fails stores no prompt, so Regenerate stays hidden until a result lands.
  • One describe at a time. A Panel with a describe job still waiting or running refuses another one.

Tests

  • crates/studio-core/tests/board_generation.rs, through the worker and the fake ComfyUI:
    • the submitted image.board graph
    • downscaling onto the canvas
    • three tones
    • Regenerate keeps the stored prompt and Annotations, and undo/redo work
    • barred Panels
    • failed jobs
    • jobs whose Panel was deleted
  • Migration test: Tile jobs survive the job-table rebuild, and the new CHECKs hold.
  • Adapter smoke test for both commands. It now points at an unused port, so it never reaches a real ComfyUI.
  • A unit test for describeBadge.
  • Full cargo test --workspace --all-features, bun test src and bun run check pass.

Not run in the real app against a live ComfyUI.

Closes #44. A filmmaker can fill a Panel's Sketch layer from a description instead of drawing it (User Stories 86 and 87). ## What changed - **Schema v16.** A job now targets a Reference version or a Panel. A describe job records its prompt, seed, tone choice and target canvas. A Panel stores what it was last described as. - **`describe_panel`** queues `image.board` at about 1 MP at the ratio of the Shot's canvas. When the image lands, Rust scales it to fill the canvas (cropping any overflow) and can reduce it to ink, grey and paper. It goes into the Sketch layer as one undoable "Describe panel" edit. Annotations are kept. - **`regenerate_panel`** queues the stored prompt and tone choice again with a new seed. Board saves keep a Panel's description. - **Board view.** Adds a "Describe…" button (its dialog has a "Reduce to 3 tones" checkbox), a "Regenerate" button, and a badge for the Panel's queued, running or failed job. Before it queues, Describe saves the Board, so the Panel has an id. - Queue entries are labelled `1A · Panel 1`. `JobDto` now has an optional target, either a Tile version or a Shot and Panel. ## Decisions worth a look - **Undo entry from the worker.** Queuing is append-only. The Sketch the job brings back is an undoable edit, as #44 asks. The worker performs that edit when the image lands, so the undo entry appears then, and it clears redo. `undo.rs` now documents this exception. - **Panels deleted while a job waits.** A Board save rewrites its Panels' rows, so `job.panel_id` has no foreign key. While its Panel is gone, a job is hidden from the queue and does not run. Undo brings both back. - **Barred Panels.** A barred Panel is described onto the Shot's current canvas. This counts as drawing on it again, so it is no longer barred. The `CONTEXT.md` Panel entry says so. - **Failed first Describe.** A first Describe… that fails stores no prompt, so Regenerate stays hidden until a result lands. - **One describe at a time.** A Panel with a describe job still waiting or running refuses another one. ## Tests - `crates/studio-core/tests/board_generation.rs`, through the worker and the fake ComfyUI: - the submitted `image.board` graph - downscaling onto the canvas - three tones - Regenerate keeps the stored prompt and Annotations, and undo/redo work - barred Panels - failed jobs - jobs whose Panel was deleted - Migration test: Tile jobs survive the job-table rebuild, and the new CHECKs hold. - Adapter smoke test for both commands. It now points at an unused port, so it never reaches a real ComfyUI. - A unit test for `describeBadge`. - Full `cargo test --workspace --all-features`, `bun test src` and `bun run check` pass. Not run in the real app against a live ComfyUI.
A Panel's Sketch layer can be drawn from a description instead of by hand.

- Schema v16: a job targets a Reference version or a Panel. A board job
  records its prompt, seed, tone choice and target canvas. A Board save
  rewrites its Panels' rows, so the job only points at its Panel: while
  the Panel is gone the job is left out of the queue and never runs.
- describe_panel queues image.board at about 1 MP at the ratio of the
  Shot's canvas. When the image lands, Rust scales it to fill that canvas,
  optionally reduces it to ink, grey and paper, and puts it in the Sketch
  layer as an undoable "Describe panel" edit that keeps the Annotations
  and stores the prompt on the Panel.
- regenerate_panel asks again with the stored prompt and tone choice and
  a new seed. Board saves keep a Panel's description.
- The Board view gets Describe... (with "Reduce to 3 tones") and
  Regenerate, and a badge for the Panel's queued, running or failed job.
Name a Panel's generated image a sketch and its job a describe job, as
Board means the whole set of Panels. The undo module now says that a
described Sketch lands as an undoable edit.
crowmaki deleted branch issue-44-describe-board 2026-10-08 09:01:04 +00:00
Sign in to join this conversation.
No description provided.