Cut layout-agent cost: contact-sheet montage instead of N single crops #4

Open
opened 2026-07-22 07:22:48 +02:00 by scarlet · 0 comments
Member

Measured on the 41-page run: roughly 100k tokens per layout agent, ~56 agent-runs, some agents making 70–100 tool calls. The spend is dominated by zoom crops read one image at a time.

Proposal: v0_annotate.py <chapter_dir> <page_stem> --sheet [--scale N] emits a single montage of all regions at ~3x, each tile labeled with its region id, so an agent verifies every glyph in one image read instead of twenty.

Related: layout agents currently verify against the annotated preview, not the rendered page — two regions passed layout and then failed QC because the bbox was a correct glyph extent but an inadequate fill target. Consider having the layout agent run the typesetter and check its own render before declaring layout_verified.

Measured on the 41-page run: roughly 100k tokens per layout agent, ~56 agent-runs, some agents making 70–100 tool calls. The spend is dominated by zoom crops read one image at a time. Proposal: `v0_annotate.py <chapter_dir> <page_stem> --sheet [--scale N]` emits a single montage of all regions at ~3x, each tile labeled with its region id, so an agent verifies every glyph in one image read instead of twenty. Related: layout agents currently verify against the annotated preview, not the rendered page — two regions passed layout and then failed QC because the bbox was a correct glyph extent but an inadequate fill target. Consider having the layout agent run the typesetter and check its own render before declaring `layout_verified`.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
TeamAI/doujin-translator#4
No description provided.