textures - fswolf/luna-local-agent GitHub Wiki
Textures
python3 portrait/texture.py irises "ice blue with silver flecks"
python3 portrait/texture.py bra "black lace with a pink trim" --count 4
> "Luna, give me three violet iris options."
New textures for her 3D model from UV templates, generated by your own ComfyUI. A template says where on the texture a part lives (a bra's cups and straps, the two eye circles); the script turns it into a mask, has ComfyUI paint the part, and puts the result back at exactly the template's size, everything outside the part transparent. Load it in VRoid's texture editor as a new layer and it lands in the right place.
It works with any checkpoint ComfyUI has; the default is
waiIllustriousSDXL_v170.safetensors. Results go to ~/luna-textures/
(or $LUNA_TEXTURES), named after the part, time and seed.
Three ways to fill a part
| Mode | What it does | Good for |
|---|---|---|
fill |
Generates a material and clips it to the shape. Long thin shapes get one square tile, mirror-tiled, so the pattern isn't stretched | Fabric, lace, latex, prints |
stamp |
Generates one picture and puts a copy in every separate island of the template | Irises: one eye, both circles |
inpaint |
Repaints just the shape on top of a base texture (--base), so it blends with what's there |
Skin details, panels, wear, decals |
Flat things work best: materials, patterns, irises, decals. Anything that has to line up across UV seams or follow the 3D shape is harder, because the model can't see how the UV map is stretched.
Presets
Each part is a preset in portrait/textures/presets.json, with its
template in portrait/textures/templates/. Adding a part means adding a
template and a few lines, no code:
"irises": {
"about": "VRoid eye irises: one iris, stamped into both circles",
"template": "irises.png", "paint": "transparent", "mode": "stamp", "mirror": true,
"prompt": "anime eye iris, front view, centered, perfectly circular, flat, {you}"
}
| Key | What it does |
|---|---|
template |
The template file |
paint |
Which part of the template is the part: opaque (VRoid's clothing templates: the shape in solid black on transparency), transparent (VRoid's eye template: circles cut out of black), or black / white for plain images |
mode |
fill, stamp or inpaint |
prompt |
Words around yours; {you} marks where yours go |
mirror |
stamp only: mirror every other copy, so the two eyes face each other |
checkpoint, steps, cfg, sampler, scheduler, negative |
Generation settings. Defaults suit Illustrious-style SDXL models: 28 steps, cfg 5.5, euler_ancestral |
denoise |
inpaint only: how much of the base to change, 0-1 |
feather |
Pixels of soft edge on the mask |
close |
Pixels of guide lines to paint over (the eye template's wireframe) |
python3 portrait/texture.py list shows them. Any template works without
a preset too:
python3 portrait/texture.py --template shirt.png --paint opaque fill "red tartan"
python3 portrait/texture.py skin "subtle freckles" --base body.png # an inpaint preset of your own
Other options: --count N, --seed N (the same seed gives the same
result), --checkpoint, --steps, --cfg, --denoise,
--comfy http://host:8188, --out folder.
From Luna
While ComfyUI is answering, she has a make_texture tool: name the part
and say what you want, and she makes up to four versions and tells you
where they are. Your own turns only; stream chat never gets it.
"comfyui": { "url": "http://127.0.0.1:8188" }
The templates
The three that ship (bra, panties, irises) are VRoid Studio's texture
templates. Export more from VRoid's texture editor (each item's template
image) and drop them in portrait/textures/templates/.
Needs Pillow (pip install pillow, or the installer's portrait
extra). Everything else happens in ComfyUI.