Skip to content

feat(website): Sprite Sheet Generator app (mocked backend) - #20866

Open
mariana953 wants to merge 15 commits into
mariana/editor-kitfrom
mariana/app-sprite-sheet
Open

mariana953 wants to merge 15 commits into
mariana/editor-kitfrom
mariana/app-sprite-sheet

Conversation

@mariana953

@mariana953 mariana953 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the Sprite Sheet Generator to the Workshop at /hub/apps/sprite-sheet/. You give it one character and get back a sprite sheet of 8 frames (4×2), which you can view as the sheet or play as an animation. It works like the reference app (/api/run/sprite-generator) and uses the shared editor kit from #20630. The backend is mocked. Built on the shared editor kit (#20630), with no dependency on Relight or Move anything. Replaces #19825. The image loader is now lib/workshop/load-image.ts, so nothing is borrowed from another app.

Changes

  • What:
    • Staff flag: workshop-sprite-sheet-app-enabled (PostHog), wired through workshop-model-availability.json like Relight.
    • Inputs and controls match the reference app:
      • Input (character)
      • Animation: free text, placeholder "e.g. dancing, soft blink…"
      • Style: Pixel / Toon / 3D, default Pixel
      • Motion: Idle / Walk / Jump, default Walk
      • Seed
      • Fixed 8 frames in a 4×2 grid
      • Run label Generate sheet
    • Panel (layout D):
      • Character row (Replace)
      • Animation text row
      • Style and Motion as picker rows (the kit's EditorPickerRow). Each row shows a thumbnail and the current value, and on desktop opens a grid of tiles beside the panel in the kit's EditorPicker, the same pattern as Cinematic's Light and Paparazzi me's Scene. Style tiles show the character drawn in each style; Motion tiles are animated. On phones the grid unfolds inside the sheet instead.
      • Seed as a direct row
      • No collapsibles or Advanced section
      • Layout E: a bottom composer with chips and trays for Animation, Style, Motion and Seed. The Animation and Seed trays no longer repeat their title as the field's label (EditorTray's field-label).
    • Views: Sheet / Preview, a toggle at the left of the control pill.
      • Sheet: the grid. It shows draft poses before a run and the generated sheet after.
      • Preview: the frames played as an animation on the stage, with play/pause, frame rate (6/8/12 fps) and onion skin in the pill.
      • Clicking a frame on the Sheet opens the Preview, paused on that frame.
    • After a run, the pill holds Edit and Try again (next seed, undoable). Download is in the header. Undo and redo sit at the right end of the pill, and the zoom control is at the bottom right.
    • All strings are in en and zh-CN (lib/workshop/sprite-sheet/copy.ts).
    • Shared kit adopted (from feat(website): shared full-screen editor pieces for the Workshop apps #20630): EditorPickerRow and EditorPicker for Style and Motion, EditorDropZone and EditorUploadSlot on the Character row, useImagePaste, and EditorRun's progress (the job's queued and percent stages). Removed the local SpriteSheetPickerRow and the Character row's own drop and file-input code.
  • Removed (the reference app does not have these, or they do not map to a backend field):
    • the Frames 4/8/12 control
    • columns, frameSize and background from the request
    • Compare (character vs sheet), whose "original" was built only on the client
    • the floating preview card, which the Preview view replaces
  • Additions:
    • Drag and drop an image onto the Character row (highlighted while held over it).
    • Paste an image from the clipboard to replace the character.
    • Run progress: "Queued", then "NN% · m:ss · 8 frames" on the photo, and Queued / NN% on the run button.
    • Download named <character>-<style>-<motion>-sheet.png (.webp for the example's prepared sheets).
    • The setup (animation text included) is kept when the character is replaced.
  • Example: a prepared character, a young explorer in a mustard jacket and teal scarf (public/images/apps/sprite-sheet/explorer.webp, a 512×640 cutout with alpha). It comes with prepared walk sheets, one per style (explorer-walk-{pixel,toon,3d}.webp, 1792×896, eight equal 448 px square cells on a clear background, the figure centred on a common baseline so Preview plays without jumps). The hub card uses explorer-card.jpg. The drawn fox example is removed.
  • Mock: runSpriteSheet (lib/workshop/sprite-sheet/mock-run.ts):
    • reports queued, then counts up to 100% over about 2.4 s;
    • for the untouched example with motion Walk, returns the prepared walk sheet for the chosen style;
    • otherwise (Idle, Jump, or an uploaded character) returns 8 frames drawn in the browser from the character, posed for the motion and redrawn in the style;
    • sends the Animation text but does not draw it;
    • returns the character as a one-frame sheet where 2D canvas is missing.

Backend contract (lib/workshop/sprite-sheet/contract.ts)

One-to-one with the reference endpoint: multipart POST /api/run/sprite-generator.

interface SpriteSheetRequest {
  image: string        // multipart file field `image`: the character
  description: string  // "Animation" free text, trimmed; '' allowed
  style: 'pixel' | 'toon' | '3d'   // default 'pixel'
  motion: 'idle' | 'walk' | 'jump' // default 'walk'
  seed: number
}
interface SpriteSheetResult {
  url: string          // one PNG, frames row by row
  frames: number       // 8
  columns: number      // 4
  rows: number         // 2
  seed: number
}
type SpriteSheetProgress =
  | { stage: 'queued' }
  | { stage: 'running'; percent: number }

The frame count is not sent; the 4×2 grid of 8 frames is fixed on both sides. There are no extension fields. The run button maps SpriteSheetProgress to the kit's RunProgress.

Review Focus

  • Undo and redo cover the animation text (typing undoes as one step), style, motion and seed. Playback state (view, play, fps, onion) is view state and is not undoable.
  • On desktop the Style and Motion grids now open beside the panel (EditorPicker) instead of over the stage.
  • Tests:
    • unit tests for the contract, the mock (layout, progress, cancel), poses and pixel ops;
    • composable tests for undo, progress, retry, edit, keeping the setup and opening a frame;
    • component tests for picker rows, the seed row, undo of the animation text, Sheet/Preview, paste, drop, composer trays and the inline phone grid;
    • an e2e that fills in the animation, picks style and motion, switches views, generates and checks the Download name.
  • Shared with the other app PRs. The app registers itself in the kit's EDITOR_APPS list on the studio page (one entry), and its copy goes through lib/workshop/app-copy.ts. Shared helpers (app-copy.ts, and where used load-image.ts, nudge.ts, useSnapshotHistory.ts) are identical in every app PR, so they merge cleanly whichever lands first.

Screenshots (if applicable)

Taken locally against the production build. They cover desktop 1440 with the example, the Style and Motion pickers, Preview, running at NN%, the result as Sheet and as Preview, phone 390 (sheet, inline style grid, result) and layout E (desktop tray, phone). There is no horizontal overflow on phone in either layout.


Generated by Claude Code

@mariana953
mariana953 requested review from a team and dante01yoon as code owners October 12, 2026 20:20
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 5c98f4a2-497d-41c7-a793-33cb9e4dae9e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

📦 Bundle Size

⏳ Size data collection in progress…

🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measure

Executes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight ecosystem-matrix shard checks are a harness self-test; the pack verdict is matrix-verdict.

This candidate changes nothing the matrix measures, so every expensive stage was skipped.

Reproduce locally
# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
  npx vitest run --config vitest.matrix.config.mts

Full docs: scripts/registry-census/README.md

🌾 Fallow: ✅ Passed

Fallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened.

No new findings in the changed files.

Reproduce locally
# the base the gate compared against
npx fallow audit --root . --quiet --format json \
  --changed-since fa6d451f5d507b9e31956425e939e0ee8d12cd1d

Full docs: ADR-DEVEX-LINT-0015

🌐 Website E2E

Tip

All tests passed.

Status ✅ Passed
Report View Report

🔗 Website Preview

Website Preview: https://comfy-website-preview-pr-20866.vercel.app

Models is built and gated by PostHog (workshop-enabled), using staging Cloud.

This commit: https://website-frontend-1cg30usjk-comfyui.vercel.app

Last updated: 2026-10-14T01:28:59Z for 6b26df6

@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.44853% with 139 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...site/src/lib/workshop/sprite-sheet/render-sheet.ts 7.44% 87 Missing ⚠️
apps/website/src/composables/useSpriteSheet.ts 82.47% 3 Missing and 14 partials ⚠️
apps/website/src/lib/workshop/load-image.ts 0.00% 6 Missing ⚠️
apps/website/src/composables/useSpritePlayback.ts 70.58% 4 Missing and 1 partial ⚠️
...mponents/workshop/sprite-sheet/SpriteSheetCell.vue 0.00% 4 Missing ⚠️
...onents/workshop/sprite-sheet/SpriteSheetStudio.vue 86.20% 3 Missing and 1 partial ⚠️
...ents/workshop/sprite-sheet/SpriteSheetPlayback.vue 40.00% 0 Missing and 3 partials ⚠️
...mponents/workshop/sprite-sheet/SpriteSheetSeed.vue 0.00% 3 Missing ⚠️
...nents/workshop/sprite-sheet/SpriteSheetSummary.vue 33.33% 2 Missing ⚠️
...e/src/components/workshop/sprite-sheet/sections.ts 77.77% 2 Missing ⚠️
... and 6 more

❌ Your patch check has failed because the patch coverage (74.44%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

@@                  Coverage Diff                  @@
##             mariana/editor-kit   #20866   +/-   ##
=====================================================
  Coverage                      ?   85.74%           
=====================================================
  Files                         ?     3589           
  Lines                         ?   169583           
  Branches                      ?    46450           
=====================================================
  Hits                          ?   145410           
  Misses                        ?    22261           
  Partials                      ?     1912           
Flag Coverage Δ
website-unit 80.33% <74.44%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ebsite/src/components/workshop/ModelsCatalogue.vue 100.00% <100.00%> (ø)
.../workshop/cinematic-studio/CinematicStudioPage.vue 91.46% <100.00%> (ø)
...nts/workshop/sprite-sheet/SpriteSheetAnimation.vue 100.00% <100.00%> (ø)
...ponents/workshop/sprite-sheet/SpriteSheetChips.vue 100.00% <100.00%> (ø)
...ponents/workshop/sprite-sheet/SpriteSheetDocks.vue 100.00% <100.00%> (ø)
...ts/workshop/sprite-sheet/SpriteSheetDraftFrame.vue 100.00% <100.00%> (ø)
...mponents/workshop/sprite-sheet/SpriteSheetGrid.vue 100.00% <100.00%> (ø)
...nents/workshop/sprite-sheet/SpriteSheetHistory.vue 100.00% <100.00%> (ø)
...mponents/workshop/sprite-sheet/SpriteSheetMain.vue 100.00% <100.00%> (ø)
...onents/workshop/sprite-sheet/SpriteSheetMotion.vue 100.00% <100.00%> (ø)
... and 37 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added the risk:high PR risk grade (advisory shadow check; grader-owned) label Oct 12, 2026

@dante01yoon dante01yoon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks. Pose/pixel logic is nicely separated and tested, and playback respects reduced motion. Requesting changes for the copy approach (shared with the sibling app PRs) and internal comments.

Size. This PR is about 3,300 lines (excluding binaries). That is far past the ~300-line guideline and hard to review well in one pass. Could you split it, e.g. (1) wiring: catalogue, routes, flag, Hub card; (2) pure lib/ logic with its tests; (3) components and e2e?

Stacking. Base is mariana/editor-kit (#20630), which is still open with changes requested. Every app PR edits the same shared lists (routes.ts, apps.ts, catalogue-apps.ts, CinematicStudioPage.vue, schema enums, locales, vercel.json), so they will conflict with each other as they land. The identical helpers (app-copy.ts, load-image.ts, useSnapshotHistory.ts, nudge.ts) would be better landed once in #20630 than duplicated in every app branch.

Checks: CI is green; I didn't run tests locally.

named: CopyValues = {}
): string {
const [one, many = one] = (entry[locale] ?? entry.en).split(' | ')
return (named.n === 1 ? one : many).replace(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

issue: appCopy fills placeholders with .replace and parses | plurals by hand, and the app's strings live in a TS copy.ts instead of src/locales/<locale>/main.json. apps/website/AGENTS.md says copy goes in main.json and is read with translationsFor(locale).t, and to "never fill a placeholder with .replace". Doing it this way also skips the catalog test that compiles each message and checks zh-CN coverage. It also treats a literal {word} the visitor types (a star name, a light name) as a placeholder whenever named has that key.

Could the app's strings move under a namespaced key in main.json (moveAnything.*, relight.*, …) and be read through t(key, named, { locale })? If keeping them out of the site-wide bundle is the real goal (as for catalogue-apps.ts), please get that exception agreed on #20630 first, where all seven apps can share it, without hand-rolled interpolation.

phase.value = next
}

/** Shows `next`, keeping the setup, releasing the previous upload. */

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

issue: this PR adds comments to internal, non-exported code, like this one and the others on inner functions of this composable. The repo rule only allows a short JSDoc on exported API. Please drop the internal ones and let the names carry the meaning.

}

/** Changes the setup; changes sharing a `key` in a row undo as one. */
function change(patch: Partial<SpriteSetup>, key?: string) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

suggestion: this is another hand-rolled undo stack (past/future/lastEdit) that matches useSnapshotHistory from the sibling PRs, keyed coalescing included. Reusing it would drop ~30 lines and keep undo behaviour identical across apps.


type Thumbnails = Partial<Record<SpriteStyle, string>>

const cache = new Map<string, Thumbnails>()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

suggestion: the module-level cache is keyed by the image URL and never pruned. Each upload is a new blob: URL, so every character a visitor tries keeps its three PNG data-URL thumbnails for the rest of the session, even after the blob is revoked. Caching only the current source (or the examples) would bound it.

* What the Sprite sheet backend receives for one run, as the multipart
* fields of `POST /api/run/sprite-generator`: `image` is sent as the file.
*/
export interface SpriteSheetRequest {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

question: SpriteSheetRequest is a hand-written request/response contract for a backend that doesn't exist yet. Is there a tracking issue for the endpoint? Once it ships in the OpenAPI spec, these types should be imported from @comfyorg/ingest-types rather than kept by hand. Could you link the issue here (or in the PR body) so the swap isn't forgotten?

This branch was previously deployed

1 inactive deployment
website-approval — 6b26df64 Deployed Oct 14, 2026 by mariana953 via fast-lane #1934
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants