Skip to content

Commit 8f37f0f

Browse files
Andrew I. ChristiansonAndrew I. Christianson
authored andcommitted
Harden exact text image prompts
1 parent 548465e commit 8f37f0f

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

api/agent/system_skills/image_generation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"lighting, palette/materials, exact text, constraints, and avoid items. Preserve an already detailed request "
1717
"instead of adding creative requirements. For a generic request, add only practical composition, framing, or "
1818
"polish details that materially help. Do not invent brands, slogans, characters, objects, palettes, or story "
19-
"elements. Put required image text in quotes, require verbatim rendering, and prohibit extra text.\n"
19+
"elements.\n"
2020
"For edits, write explicit invariants such as `change only X; preserve Y unchanged`, including identity, "
2121
"geometry, layout, typography, lighting, or surrounding objects as applicable. Repeat those invariants on every "
2222
"iteration. Make one targeted change per iteration and pass the prior generated file in `source_images` when "

api/agent/tools/create_image.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,8 @@ def get_create_image_tool() -> Dict[str, Any]:
444444
"type": "string",
445445
"description": (
446446
"Natural-language image prompt describing the desired output. Include enough concrete "
447-
"visual detail for a new asset, edit, style transfer, or art direction."
447+
"visual detail for a new asset, edit, style transfer, or art direction. Quote required "
448+
"in-image text, require verbatim rendering, and prohibit extra text."
448449
),
449450
},
450451
"file_path": {

api/evals/tests/test_image_generation.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ def test_eval_create_image_definition_matches_production_contract(self):
6565
self.assertEqual(synthetic["description"], production["description"])
6666
self.assertEqual(synthetic["parameters"], production["parameters"])
6767
self.assertEqual(synthetic["system_skill_key"], IMAGE_GENERATION_SYSTEM_SKILL_KEY)
68+
self.assertIn(
69+
"require verbatim rendering",
70+
production["parameters"]["properties"]["prompt"]["description"],
71+
)
6872

6973
def test_cases_encode_source_text_multi_asset_and_negative_constraints(self):
7074
by_slug = {case.slug: case for case in IMAGE_GENERATION_CASES}

0 commit comments

Comments
 (0)