Files
Robot-Clash/sprite-generator/variants.py

54 lines
3.4 KiB
Python
Raw Normal View History

"""Robot Clash - shop images made from the real 3D parts (generate_variants.py, Flux.2 Klein + ReferenceLatent).
Reference r3d_<id> = the part exactly as the game builds it (tools/partshots.ps1 renders them into output/).
Flux keeps shape, proportions and viewing angle and paints it in the sprite style, so the shop picture
matches what ends up on the robot.
..\\tools\\partshots.ps1 3D renders -> output/r3d_<id>_raw_00001_.png
gen generate_variants all part images (part_<id>)
gen adopt --size 192 part_<id>
VARIANTS = [(name, ref_name, prompt)]
"""
STYLE = (
"keep exactly the same object, the same shape, proportions, parts and viewing angle as the reference image; "
"render it as a detailed game sprite: scratched painted steel, bolts and rivets, small yellow and black hazard stripe details, "
"soft studio lighting, crisp edges, high detail, centred single subject, plain solid black background, no text"
)
_P = {
'crate': "a plain rectangular steel robot chassis box with a raised accent strip on top",
'doorstop': "a low wedge-shaped steel robot chassis, flat sloped front, hazard stripes on the flat rear deck",
'bulwark': "a large heavy rectangular steel robot chassis box with a raised accent strip on top",
'scarab': "a robot chassis base plate with a smooth round steel dome shell and an accent ring around the dome",
'rubber': "a set of four small rubber robot wheels with steel hubs",
'bigtyre': "a pair of huge chunky rubber tyres with steel hubs",
'tracks': "a pair of long tank crawler tracks with round end wheels",
'steel': "a U-shaped set of three plain grey riveted steel armour plates (two side plates and a rear plate)",
'titan': "a U-shaped set of three light blue-grey titanium armour panels with bolts",
'hardox': "a U-shaped set of three thick yellowish hardened steel wear plates with heavy bolts",
'wedge': "a flat angled steel ramming wedge plate",
'flipper': "a flat steel flipper plate with an accent stripe, hinged at its rear edge",
'hammer': "a robot axe hammer: long steel arm on a pivot block with an axe head pointing down at the end",
'saw': "a large circular saw blade on a short motor arm",
'crusher': "two hydraulic crusher jaw arms side by side with sharp teeth at the tips",
'spinner': "a long horizontal steel spinner bar with hardened teeth blocks at both ends on a central hub",
'flamer': "a small robot turret base with a red fuel tank and a steel flamethrower nozzle",
'minigun': "a small robot turret base with a housing and a rotating multi-barrel minigun",
'rockets': "a small robot turret base carrying a box-shaped rocket pod with four tubes",
}
VARIANTS = [(f"part_{k}", f"r3d_{k}", v) for k, v in _P.items()]
# motor + battery are not visible on the 3D robot: restyle the existing picture (reference = itself)
_INNER = {
'sparky': "a small cheap electric motor with a few wires",
'hornet': "a sleek electric motor with cooling fins",
'bulldog': "a massive high torque gear motor with a big gearbox",
'comet': "a high speed racing electric motor with a glowing blue cooling ring",
'lead': "a heavy old lead acid battery block with two terminals",
'nicd': "a pack of green battery cells strapped together",
'lipo': "a slim modern lithium battery stack with small charge lights",
}
VARIANTS += [(f"part_{k}", f"part_{k}", v) for k, v in _INNER.items()]