Skip to content

Latest commit

 

History

History
70 lines (49 loc) · 3.79 KB

CONTRIBUTING.md

File metadata and controls

70 lines (49 loc) · 3.79 KB

Contributing to AI Visual Prompt Cookbook

How to Submit a New Style

  1. Fork the repository and create a new branch.
  2. Add a new directory under styles/<slug>/.
  3. Add exactly one style.json file and two preview images.
  4. Run python3 scripts/publish-style.py --add <slug>="one-line gallery summary" (add --feature <slug> to feature it). It adds the style to the top of data/catalog.json, then regenerates every README, docs/CATALOG.md, the copy prompts and the site data, and validates everything.
  5. Run the validation command.
  6. Open a pull request with a short description of the visual system and sample use cases.

Style Slug Naming

  • Use lowercase English kebab-case.
  • Keep the slug descriptive and no longer than 60 characters.
  • Prefer concrete style words over generic labels.
  • Match the folder name, style_slug, and copy-prompt filename.

style.json Requirements

Each public style must include these fields:

  • prompt_template
  • environment_variables
  • examples
  • style_fidelity_anchors
  • source_content_to_avoid
  • negative_prompt
  • category (Photo + Doodle, Zine + Collage, Type Posters, Travel + City, Editorial + Minimal, or Product + Campaign)
  • style_name and style_summary written in English

Two versions are accepted. A v2.1 style (no schema_version) declares the ten standard variables (SUBJECT, SUBJECT_ACTION, PRODUCT_OR_PROP, LOCATION, BACKGROUND_ELEMENTS, MAIN_TEXT, SECONDARY_TEXT, ACCENT_SYMBOL, WARDROBE_STYLE, ASPECT_RATIO). A v2.2 style sets "schema_version": "2.2" and declares only the variables its template uses: ASPECT_RATIO is required, every declared variable must appear in prompt_template, and every example sets every variable except ASPECT_RATIO, STYLE_FIDELITY_ANCHORS, SOURCE_CONTENT_TO_AVOID and NEGATIVE_PROMPT, which are filled from the style itself.

The template should preserve the reusable visual system while requiring new subject matter, text, and scene values.

Preview Image Requirements

  • Filenames must be exactly preview-16x9.jpg and preview-9x16.jpg.
  • Recommended minimum resolution: 1280x720 for 16:9 and 720x1280 for 9:16.
  • Use JPG format, at most 800 KB each and no more than 2560px on the long side. CI checks this. python3 scripts/optimize-images.py <slug> shrinks oversized previews (publish-style.py runs it for you).
  • Avoid visible watermarks, platform UI, QR codes, account handles, or brand-owned marks.

README and Catalog

The Featured and All Styles galleries in all six READMEs, the badge counts, and docs/CATALOG.md are generated from data/catalog.json plus each style.json. Do not edit those sections by hand; CI regenerates them and fails if they differ.

  • styles: gallery order, newest first. Each entry has slug, a short summary, and optional summary_i18n translations keyed by zh-CN, zh-TW, ja, ko, id.
  • featured: exactly six styles. description is optional and defaults to the style's style_summary.

Validation

Run this command from the repository root before submitting:

python3 scripts/validate-style-json.py .

What Not to Include

Do not include original reference images, watermarks, platform identifiers, QR codes, account information, private prompts, or unauthorized brand assets.

PR Checklist

  • The new folder is under styles/<slug>/.
  • The folder contains only style.json, preview-16x9.jpg, and preview-9x16.jpg.
  • The slug is lowercase kebab-case and no longer than 60 characters.
  • The preview images are JPGs and meet the naming requirements.
  • python3 scripts/publish-style.py --add <slug>="..." has been run and passes.
  • python3 scripts/validate-style-json.py . passes.
  • No source references, watermarks, QR codes, account handles, or unauthorized brand assets are included.