Skip to content

[feat] canvas: apply image presets as prompt skills - #529

Open
Probiotics5333 wants to merge 1 commit into
ThinkFlowLab:mainfrom
Probiotics5333:feat/image-preset-prompt-skill
Open

Probiotics5333 wants to merge 1 commit into
ThinkFlowLab:mainfrom
Probiotics5333:feat/image-preset-prompt-skill

Conversation

@Probiotics5333

Copy link
Copy Markdown
Collaborator

Summary

Make image presets behave as prompt skills instead of a model-locked generation parameter.

  • Preset definitions move to domain/image_presets.py; generation jobs, the image-presets tool and the composer share one source of truth.
  • The composer stores a preset as an editable skill chip. It can switch presets, tune the four-view face-emphasis variant, remove the preset, and preview or copy the instructions it will inject.
  • Job acceptance freezes the resolved preset text into InputSnapshot.presetPrompt; submission prepends it to the prompt and prompt content, so retry and resume keep the same instructions.
  • Changing the model no longer clears a prompt-skill preset. Only the legacy product-views service preset keeps the old clearing rule.
  • Reference lists are built from the images that actually take part in the request; without an image reference the preset's text-only instructions are used.
  • The tool catalog publishes prompts, textPrompts and the face-emphasis variants, and the creation contract is regenerated for preset / faceEmphasis.
  • Bilingual copy, tests and the project fixture are updated.

Scope not covered: presets stay single-select, and existing product-views drafts keep their legacy generation-parameter behavior.

Linked issue

  • Fixes #N included

Fixes #528

Labels

  • Labels applied: type:feat, area:canvas

Test plan

  • Local:
    • npx tsc --noEmit — clean.
    • npm run build — succeeded.
    • pytest tests/test_creation_generation_service.py — 26 passed.
    • node --test tests/promptSkill.test.ts — 9 passed.
    • node scripts/check-i18n.mjs — 0 problems.
    • python scripts/generate_contracts.py --check — verified.
  • Left to CI: the static, Python, frontend and browser lanes in checks.

Evidence that it works

  • Media attached, or N/A because: the change adds a preset chip, an adjust popover and a preview dialog inside the existing composer; no new screen was added. The preset text selection, reference ordering, face emphasis and frozen snapshot are asserted by Python and Node tests against provider doubles.

Provider verification

  • Real-provider calls are described honestly, or none were made

No real image model was called. Tests use a provider double and inspect the accepted job snapshot and the request prompt; actual image output quality is unverified.

Bilingual UI

  • Both locales are updated

generation.preset.* and the preset descriptions ship in zh-CN and en-US.

## summary

- Move the image preset definitions into `domain/image_presets.py` so generation
  jobs, the `image-presets` tool and the composer share one source of truth.
- Store a preset as an editable skill chip in the prompt instead of locking a
  generation parameter: the composer shows the preset, can tune the four-view
  face-emphasis variant, remove it, and preview or copy its instructions.
- Freeze the resolved preset text into `InputSnapshot.presetPrompt` when a job
  is accepted, and prepend it to the prompt and prompt content at submission, so
  retry and resume keep the same instructions.
- Keep the preset when the model changes; only the legacy `product-views`
  generation preset keeps the old clearing rule.
- Publish prompts, text prompts and the face-emphasis variants through the tool
  catalog, and regenerate the creation contract for `preset`/`faceEmphasis`.
- Cover preset text selection, reference ordering, face emphasis and the frozen
  snapshot with tests, and add the bilingual copy.

## validation

- `npx tsc --noEmit`: clean.
- `npm run build`: succeeded.
- `pytest tests/test_creation_generation_service.py`: 26 passed.
- `node --test tests/promptSkill.test.ts`: 9 passed.
- `node scripts/check-i18n.mjs`: 0 problems.
- `python scripts/generate_contracts.py --check`: verified.

Fixes: ThinkFlowLab#528
@Probiotics5333 Probiotics5333 added area:canvas Canvas, nodes and direct manipulation type:feat New capability or behaviour labels Nov 26, 2026
@github-actions
github-actions Bot requested a review from allendyu November 26, 2026 17:13

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:canvas Canvas, nodes and direct manipulation type:feat New capability or behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] canvas: 图片预设作为提示词技能应用于任意图片模型

1 participant