Style Grid replaces the default style dropdown with a fast, visual interface for browsing, selecting, and applying styles in all major Stable Diffusion WebUI builds.
It supports:
- category-based browsing
- source-aware filtering
- deduplicated All Sources view with source picker
- favorites and recent styles
- drag reorder of selected styles
- presets, backup, import/export
- thumbnail generation/upload and cleanup tools
See CHANGELOG.md for full release history.
- Open Extensions in Forge.
- Go to Install from URL.
- Paste this repository URL and install.
- Restart Forge UI.
cd /path/to/stable-diffusion-webui-forge/extensions
git clone <this-repository-url> sd-webui-style-organizerRestart Forge UI after cloning.
- Open
txt2imgorimg2img. - Click the Style Grid trigger button to open the panel.
- Pick a source (
All Sourcesor a specific CSV). - Search or browse categories.
- Click a style card to apply/unapply.
- Use the top bar icon buttons (right of the search box) for presets, backup, import/export, etc.
(The 📋 CSV table editor slot is visible but temporarily disabled — hover for the tooltip.)
Style Grid works in both generation tabs:
- txt2img
- img2img
Behavior is the same in both modes (source filter, deduplication, favorites/recent, context menus, previews, presets). The small tab badge in the panel header shows the active host context.
- Use the left sidebar for category filtering.
- Use source dropdown for CSV-level filtering.
- Use search box for instant name filtering.
- Type in the search box to filter cards by style name in real time.
- A suggestion popup appears while you type and shows matching style names with their category.
- Use arrow keys + Enter to pick a suggestion quickly, or click the item with mouse.
- Search respects your current source/category view, so results stay relevant to what is on screen.
- Card click toggles selection and applies/unapplies style.
- Selected styles are tracked in the bottom selected bar.
- Reorder selected styles by dragging chips in the selected bar.
- With All Sources selected, the grid shows one card per style name even if that name appears in several CSV files.
- If the same name exists in more than one file, the first click on that card does not toggle the style yet — it opens a small source picker next to the card.
- The picker lists each duplicate as the CSV file name only (no folder path, no
.csvextension). Choose the row you want; that variant is applied like a normal selection. - Click outside the picker to close it without applying.
- If you pick a specific source in the dropdown, you always see that file’s styles only — duplicates from other files are not shown together, so the picker is not used.
- Favorites: right‑click a style card → Add to Favorites / Remove from Favorites (there is no star icon on the tile itself).
- Recent lists the last styles you applied (up to 10), grouped by category like the main grid.
- Open Favorites or Recent in the left sidebar to filter the grid to those lists.
Where to open it
- Right-click a category row in the left sidebar (the colored category list).
- Right-click the category header in the main grid when the view is grouped by category (e.g. All, Favorites, Recent — the sticky row with
▼ CATEGORY (count)and Select All).
(A normal left-click on that header only collapses/expands the section.)
Menu actions
| Item | What it does |
|---|---|
| Add category as wildcard | Inserts a token into the positive prompt on the Forge side: {sg:<category>}. The category name is normalized to lowercase to match how styles are grouped. |
| Generate previews | Queues thumbnail generation for styles in that category (batch job in the host). |
How {sg:…} wildcards work
- Syntax:
{sg:<category>}— curly braces, the prefixsg:, then the category label as it appears in Style Grid (e.g.ACCESSORYoraccessory). Only this pattern is special; the regex is\{sg:…\}(seestylegrid/wildcards.py). - When it runs: tokens are expanded at generation time inside Style Grid’s own processing hook (
scripts/style_grid.py), before the rest of the prompt is handled like a normal Forge prompt. - What gets inserted: one random style from that category; the replacement text is that style’s
promptfield from CSV (notnegative_prompt). Category matching is case-insensitive. - Where you can put it: positive or negative prompt box — both strings are scanned. If the category is unknown or empty, the
{sg:…}text is left as-is (no error). - You can type or paste tokens manually; the context menu only inserts the same format.
Compatibility with other “wildcard” extensions (e.g. stable-diffusion-webui-wildcards / Dynamic Prompts __file__ style)
- Those stacks usually recognize different syntax — commonly
__name__(double underscores) or other Dynamic Prompts / custom grammar — not{sg:…}. - Style Grid only looks for
{sg:…}; other extensions only interpret their patterns. The two do not use the same delimiters, so they do not fight over the same text in normal use. - You do not need the Automatic1111 wildcards extension (or any extra wildcard plugin) for Style Grid’s
{sg:…}feature — it is implemented inside this extension (Pythonresolve_sg_wildcards+ your style CSV data). Other wildcard extensions remain optional for their own__…__/ file-based workflows.
Generate previews — sidebar vs grid
- From the grid header menu, Generate previews (N missing) appears only when the UI thinks N styles in that category still need a cached preview.
- From the sidebar category menu, Generate previews… is always shown for that category (full pass for the category).
Where to open it
- Right-click a style card in the grid. (Left-click still applies the normal select / source-picker rules.)
Menu actions
| Item | What it does |
|---|---|
| Select / Deselect | Same as a left-click on the card: applies or removes the style from the active selection (and host prompt), without opening the duplicate-source picker. |
| Add to Favorites / Remove from Favorites | Toggles the star list for this style name. |
| Copy prompt | Copies this style’s prompt text to the clipboard. |
| Edit | Opens the host style editor for this style. |
| Duplicate | Opens the host flow to duplicate the style (typically into the same or chosen source). |
| Move to category… | Opens the host dialog to change the style’s category field. |
| Generate preview (SD) | Runs thumbnail generation for this style (Stable Diffusion–based preview in the host). |
| Upload preview image | Opens the host file picker to set a custom thumbnail image. |
| Delete | Removes the style (host confirms and updates CSV). |
Click outside the menu, or move the pointer off the menu panel, to close it.
Generating a preview
- Per style: open the style’s context menu (right-click the card) → Generate preview (SD). The host runs an SD render and saves an image under
data/thumbnails/(see Data and Persistence). - Per category: use the category context menu → Generate previews… (see §5).
After a successful run, the iframe is notified so the UI can refresh that style’s thumbnail version.
Thumbnail images are loaded via GET /style_grid/thumbnail?name=… (the server picks the on-disk file from the legacy hash or from cached rows with that name). Preview URLs may still include source / version for browser cache. When generating a preview for a specific CSV row, the host sends the active source in POST /style_grid/thumbnail/generate so the correct row is used if names overlap.
What the card shows
- The grid card is a compact label (name and category color accent). The generated image is not shown inside the tile — you see it when you hover.
Hover popup (preview window)
- Pause ~300 ms on a card to open the popup (reduces flicker when moving the mouse quickly).
- Top: the thumbnail image (if the file exists and loads). If the image is missing or fails to load, you still get the text below.
- Title: the style display name.
- Prompt: first 120 characters of the style’s
promptcolumn, with...if longer. - Negative: first 60 characters of
negative_prompt, prefixed with − and shown in a muted red tone.
The popup is fixed near the card and flips above or below depending on available space.
- Click the Fullscreen button in the top-right corner of the panel to switch between floating window mode and edge-to-edge view.
- Fullscreen gives the grid and sidebar more horizontal space, which is useful for large category lists and long browsing sessions.
- Click the same button again to return to the regular floating panel size.
What this means: not a separate “toolbar” window — it is the top header row of the Style Grid panel: logo, txt2img/img2img tag, source dropdown, search, then a row of small icon buttons on the right. Hover an icon to see its tooltip.
| Control | What it does |
|---|---|
| 👁 | Silent mode — styles are applied at generate time (hidden JSON on the Forge host), not in the prompt text fields. Turning silent off clears that host list, so the next generation no longer uses silent injection. The V2 grid may still look as if styles are selected (highlight/chips/count) until you click them or use Clear — that is visual only and does not change what silent mode already cleared for generation. Toggling a style off while silent still updates the host list. |
| 🎲 | Random style — picks a random style (respects the active source filter). |
| 📦 | Presets — save/load/delete style sets from the host modal. Load runs the same loadPreset path as choosing a preset in the sidebar Presets view (iframe posts SG_LOAD_PRESET). Both clear/apply on the host and sync the V2 selected bar (SG_CLEAR_SELECTION / SG_STYLE_APPLIED per style). |
| 💾 | Backup — creates CSV backup snapshot(s) under data/backups/. Failures, HTTP errors, or “nothing to copy” are reported via toasts (see docs/API.md § /backup). |
| 📥 | Import / Export — export/import styles, presets, usage. |
| 📋 | CSV table editor — temporarily unavailable (control is semi-transparent / disabled; tooltip explains this). The full-screen table UI is not opened. Implementation is preserved in javascript/style_grid.js as a block comment for maintainers who want to turn it back on; see docs/DEVELOPMENT.md. When re-enabled, it would target the same CSV as New style (a specific file in the source dropdown, not All Sources), using the persisted source filter. |
| 🧹 | Clear — clears all selected styles in the panel and on the host prompt. |
| ▪ | Compact mode — toggles a denser card layout. |
| ↕ | Collapse all or Expand all category sections (depends on current state). |
| ➕ | New style — creates a style in the currently selected CSV (All Sources must be switched to a specific file first). |
| (number) | Shows how many styles are selected; |
| Fullscreen | Toggles between the floating panel size and edge-to-edge layout. |
| ✕ | Close — closes the Style Grid panel. |
Generated files are stored in data/:
| File/Folder | Purpose |
|---|---|
data/presets.json |
Saved presets |
data/usage.json |
Usage counters |
data/category_order.json |
Persisted category order |
data/backups/ |
CSV backups |
data/thumbnails/ |
Thumbnail image cache |
Local UI state is also stored in browser localStorage (active source, favorites, recent, compact/collapse preferences).
Primary style fields:
namepromptnegative_prompt- optional metadata:
description,category
Detailed specification: docs/CSV_FORMAT.md.
- API reference:
docs/API.md - Development guide:
docs/DEVELOPMENT.md - V2 React bundle (iframe loading, Zustand
useShallow,selectFilteredStyles):ui/README.md(also overlaps with GET/style_grid/uiindocs/API.md).
| Issue | What to check |
|---|---|
| Panel does not open | Extension enabled + full Forge restart. |
| Styles missing | CSV location/encoding/header correctness. |
| Source picker not shown | Must be in All Sources, and style must exist in multiple CSVs. |
| Order seems wrong | Check active source and category order persistence rules. |
| Thumbnails not appearing | Verify generation/upload status and data/thumbnails/ permissions. If a name exists in several CSVs, generation must target the intended row (body source on POST /style_grid/thumbnail/generate); GET /style_grid/thumbnail resolves from the cached style list when the legacy file is missing. |
| CSV table editor grayed out / toast “temporarily unavailable” | Expected: the feature is disabled by design. Edit styles per row via the style editor or CSV on disk; see docs/DEVELOPMENT.md to restore the table editor from the commented source. |
PNG files live under docs/screenshots/ and are named to match sections in this README. If the UI changes, replace the images but keep the same filenames (see docs/screenshots/README.md for a refresh checklist).
AGPL-3.0 (LICENSE)










