Skip to content

Sketch Editor AIDA

Sketch Editor AIDA is the conversational editor for producing new versions of the selected shot sketch. It is implemented as a separate guru from Image AIDA and from Sketch Analysis AIDA.

Behavior

  • The editor is opened from a sketch in Full Preview through Tweak or Ask AIDA.
  • Editing always uses the canonical sketch where shot.sketches[].isSelected is true. A previewed non-selected sketch must be promoted before editing.
  • A user can provide an edit instruction and up to three reference images.
  • AIDA can request polygon selection or camera placement before performing an edit.
  • One edit always creates two candidates: one Nano Banana Pro result and one GPT Image 2 result.
  • Both candidates are stored as one batch in shot.sketches[] with TWEAKED_SKETCH source and inherit the source sketch's connectedTo value.
  • The first successful candidate is selected atomically. A later success remains available but does not replace it.
  • The shared result picker allows either successful candidate to be selected explicitly.
  • Pending candidates appear as two loading slots. Failed or cancelled empty slots are omitted from the normal Sketches gallery after the batch settles.
  • Chat history is persisted per shot and isolated from Image AIDA by guru type.

Sketch editing does not run Sketch Analysis or copy analysis from the source URL. An edited sketch is a new URL and follows the existing URL-scoped analysis and pre-generation flow when it is later used to generate a rendered shot image.

Contract

The canonical guru type is:

SHOT_SKETCH_EDITOR = "shot_sketch_editor"

The frontend uses the shared workbench guru endpoints:

POST /workbench/guru/message
GET  /workbench/guru/session

The fixed generation count sent with an edit is:

{
  "google-i2i-nanoBananaPro": 1,
  "i2i-gpt-image-2": 1
}

The backend validates this map and independently enforces exactly one configuration for each model.

Relevant tools are:

  • edit_sketch
  • guard_sketch_edit
  • request_polygon_selection
  • request_camera_placement
  • confirm_shot_camera_change

The guard and camera-confirmation tools are internal orchestration details and are not rendered as normal chat tools.

Persistence And Realtime

Batch dispatch appends two PROCESSING placeholders before provider generation starts. Each placeholder records its job ID, source sketch URL, batch ID, batch index, and batch size. Metadata updates explicitly requested with the edit are normalized and persisted in the same guarded write.

Each provider settles only its own placeholder. Realtime state is delivered through:

  • shotSketchBatchStarted
  • shotSketchBatchProgress
  • shotUpdated as the authoritative final shot snapshot

Selection uses POST /workbench/updateShotImageSelection with type: "SKETCH"; batch selection audit data is recorded through POST /workbench/updateShotSketchBatchSelection.

Permissions And Limits

  • Shot edit permission and impersonation state gate edits, interactive tools, and candidate selection.
  • FEAT_IMAGE_TWEAK_CANVAS controls whether Tweak opens the canvas overlay or the side panel.
  • FEAT_MAGIC_SELECT controls only the canvas magic-select tool.
  • There is no separate Sketch Editor or multi-generation permission.
  • Credits and the shared 50-edits-per-shot limit gate message submission.

Key Files

Backend:

  • src/agenticGuru/sketchImageEditGuru.ts
  • src/agenticGuru/agenticGuru.types.ts
  • src/promptTemplates/agenticGuruSystemPrompts/sketchImageEditGuruPromptv20260910.ts
  • src/promptTemplates/agenticGuruSystemPrompts/sketchImageEditGuardPromptv20260910.ts
  • src/assetGenModelConfigs/workbenchV2/sketchImageEditModels.ts
  • src/workbench/guruChat/guruChat.service.ts
  • src/workbench/workbench.service.ts
  • src/models/guruChatSessions.model.ts
  • src/models/storyVideos.model.ts

Frontend:

  • app/_hooks/useSketchImageEditGuru.ts
  • app/_hooks/useSketchImageEditChatPanel.ts
  • app/_hooks/useFullPreviewModal.ts
  • app/_components/v2/layouts/studio/shot/sketchImageEditChatPanel.tsx
  • app/_components/v2/layouts/studio/shot/messageItem.tsx
  • app/_helpers/shotImageCohorts.ts

Sketch Analysis

Sketch Analysis AIDA is documented separately in sketch-aida.md. It analyzes a specific sketch URL, gathers annotations and metadata confirmation, and stores generation guidance in shot.sketchAnalyses[]; it does not create edited sketch candidates.