一键导入
logo-composite
How the generate-then-composite pipeline puts a pixel-perfect canonical logo onto a generated image without letting the LLM regenerate the logo.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
How the generate-then-composite pipeline puts a pixel-perfect canonical logo onto a generated image without letting the LLM regenerate the logo.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
How to look up version-matched Agent Native framework docs and source in node_modules. Use before coding against @agent-native/core APIs or advanced features.
Creating, editing, and managing extensions — sandboxed Alpine.js mini-apps that run inside iframes. Use when a user asks for a dashboard, widget, calculator, or any interactive mini-app that calls external APIs. Distinct from LLM "tools" (function calls) — see note below.
Agent observability, evals, feedback, and experiments. Use when adding observability dashboards, configuring trace capture, setting up evals, creating A/B experiments, or collecting user feedback on agent responses.
Server-side analytics tracking with pluggable providers. Use when adding analytics events, registering custom tracking providers, or configuring built-in providers (PostHog, Mixpanel, Amplitude, Webhook).
Live calendar-backed meetings in Clips — upcoming Google Calendar events, desktop join/record reminders, live transcripts with mic + system-audio capture, AI summary / bullets / per-attendee action items, and the bidirectional recording↔meeting link. Use when listing meetings, opening a meeting detail, finalizing notes, connecting a calendar, or working with attendee-tagged transcript segments.
Declare, evaluate, manage, and remove framework feature flags. Use when shipping a capability gradually, targeting users or organizations, or replacing a compile-time rollout switch with a production-safe runtime flag.
| name | logo-composite |
| description | How the generate-then-composite pipeline puts a pixel-perfect canonical logo onto a generated image without letting the LLM regenerate the logo. |
LLMs — including Gemini Pro — degrade complex logos. They smear gradients, drop text, and rearrange elements. The Assets app sidesteps this entirely with a generate-then-composite pipeline that every serious brand-imagery system uses today.
canonicalLogoUrl (set via set-canonical-logo --libraryId --assetId). The asset's role is logo_reference.includeLogo (stored in the preset settings and surfaced as a first-class field). When a generation resolves to a preset with includeLogo: true, generate-image composites the logo. A generate call's own includeLogo arg, when passed, overrides the preset for that run; when omitted, the preset's value wins.settings.skeletonSpec: background first, generated subject second, foreground layers last. If the skeleton already has a foreground layer with source: "canonicalLogo", includeLogo is treated as a no-op for that run so the logo is not stamped twice. If the skeleton does not include the logo and includeLogo is true, the existing canonical-logo layer is appended at the default upper-right position during compositing.Leave a clean uncluttered area in the upper-right for the real brand logo; do not draw or approximate the logo yourself.
compositeLogo() from server/lib/image-processing.ts (Sharp) loads the canonical logo PNG / SVG, resizes it to ~16% of the image width with reasonable inset, and composites it onto the generated image. Skeleton runs use applyPresetSkeleton() at the same seam.settings.skeletonSpec is the prototype storage shape:
{
background: { type: "asset"; assetId: string };
mask?: { type: "asset"; assetId: string };
contentMode: "fill" | "cutout";
contentRegion?: { x: number; y: number; w: number; h: number };
dropShadow?: boolean;
foreground?: Array<{
source: "canonicalLogo" | { assetId: string };
x: number;
y: number;
w: number;
}>;
}
fill drops an opaque generation into the content region, so it works through the normal managed provider path.gpt-image-2, the action sends a managed edit/inpaint request instead of generate-then-composite: the uploaded plate is the edit_target, an optional same-size mask asset becomes the editable-area mask, and maskFromPlateAlpha() is only the fallback when no manual mask is set. Transparent mask pixels are editable, opaque pixels are sent as preserved regions, and the returned image is final. The manual mask or plate fallback must have transparent pixels.cutout skeletons ask for an isolated transparent subject, force gpt-image-1, attach the background plate as a background_reference/composition reference, request background: "transparent" through the managed Builder image provider, and only fall back to OpenAI BYOK when the managed provider fails. They clamp only the provider subject ratio to 1:1, 2:3, or 3:2. The final skeleton canvas still uses the preset's requested aspect ratio.assetId values must belong to the selected brand kit and must be images.includeLogo: true on that single generate call to override the preset.upload reference image (role: logo_reference, category: logo) →
set-canonical-logo --libraryId=<id> --assetId=<asset-id>
set-canonical-logo flips the asset's role to logo_reference AND its status to reference. This means the reference selector won't pick up generated logo candidates as canonical — only intentionally pinned uploads.
In image-processing.ts:compositeLogo():
max(120, round(imageWidth * 0.16)) — ~16% of the image, but never smaller than 120 px.max(24, round(min(width, height) * 0.035)) — ~3.5% of the smaller dimension, but never less than 24 px.top: inset, left: width - logoWidth - inset).If you change these, also update the corresponding language in the prompt envelope ("upper-right") so the LLM's clean area aligns with where Sharp will composite.
The same logic applies to body and headline text. Image models still smear small letters and rearrange long strings. The Assets app's prompt envelope explicitly says:
Do not render headlines, body text, UI labels, or prompt wording inside the image unless the user explicitly asks for exact visible text.
Overlay text in HTML/CSS in the calling app (slides, design, mail) — it's more reliable, more accessible, and the user can edit it without re-running the generation.
canonicalLogoAssetId at generate time, so racing here is rare; but the variant slot will reflect whichever logo was current when the call landed.