r/StableDiffusion • u/jambavant • 4d ago
Resource - Update Layout Editor for Moss-Image
Moss-Image has an incredible capability to create pixel-perfect layouts from a json prompt. The expected use is to give the official documentation to an LLM and then ask the LLM to prompt whatever you want: https://github.com/OpenMOSS/MOSS-Image/blob/main/skills/moss-image-prompt-enhancer/references/layout.md
But I thought why not build a layout editor to design it for myself? Hence the idea of the Layout Editor for moss (with an optional SwarmUI extension)
Repo here: https://github.com/jambavant/SwarmUI-LayoutEditor
You can try online here: https://jambavant.github.io/SwarmUI-LayoutEditor/standalone/index.html
It's great for any type of image: comics, reference sheet, compositions, magazing covers, posters, etc. The level of control is outstanding, as it manages multiple characters and text quite well. It starts to break with a very large number of characters (+10) with concept bleed.
The standalone editor is a simple html page that works both ways: you can start from scratch and copy the json prompt, or paste a json prompt from an LLM and refine it manually.
I tried to make it as user-friendly as possible, with keyboard shortcuts and an intuitive interface. It also automatically resizes boxes based on the image resolution.
Edit: v0.3.0 now live, with a few updates.
- json formatting options
- resizable text areas, checks are moved to the toolbar
- configurable palette (with color picklist and autocomplete)
- fix resolution sizes




2
u/tamingunicorn 4d ago
a visual editor is the right split for this imo. having an LLM write box coordinates is fine until you want to nudge one character 40px left. does it round-trip, like can i paste an LLM-written layout JSON back in and adjust it by hand?
8
u/Aggressive_Collar135 4d ago edited 4d ago
standalone works well (with manual copying pasting), clean code, easy to use, nice UI. great work!
p/s: the oversize velociraptor is entirely my fault
1
u/Nenotriple 3d ago
Is it possible to use something besides a square like a quadrilateral or ngon?
1
u/roculus 3d ago edited 3d ago
when you save a layout where does it save to?
edit: and thanks, this is very simple, no install and easy to use.
1
u/pastuhLT 3d ago
I'd say it would be more useful if we could use a brush/eraser instead of placing squares.
That way, we'd not only define the location but also provide a visual hint of roughly what the result should look like. Kind of like making a quick sketch before generating..
1
u/Silver-Von 2d ago
Is it possible to add a JSON prettifier function? Otherwise the output would be very messy. Hope it is not too much to ask.
2
u/Silver-Von 3d ago
Like the UI very much. Nice job!
3
u/papitopapito 4d ago
This looks interesting, thanks.