Files
linkspin/tools/promo-kit-masters.py
T

26 lines
2.3 KiB
Python

# LinkSpin promo kit key visuals via kie.ai nano-banana-pro (textless): one landscape, one portrait master.
import os, subprocess, sys, pathlib, time
HERE = pathlib.Path(__file__).parent; OUT = HERE / 'masters'; OUT.mkdir(exist_ok=True)
GEN = r'D:\Projects\BannerKitAI\render\scripts\generate-banner-image.py'
env = dict(os.environ, KIE_API_KEY=open(r'C:\Users\Marty\.kie-key').read().strip(), PYTHONIOENCODING='utf-8')
STYLE = (' Cinematic 3D render, photoreal materials, dark navy studio background (#0B1220), volumetric haze, shallow depth of field. '
'Colour palette: deep navy, electric blue (#3B9DFF) light, one accent of signal orange (#FF6A1A). '
'Absolutely no text, no letters, no logos, no UI, no watermark. Full-bleed: the scene extends past all four edges, no frame, no mockup, no border.')
SHOTS = {
'master-landscape': ('A glowing ring of blue light spinning in the dark like a precision instrument dial, with four thin luminous paths branching out of it toward floating glass panels at the right side of the frame, '
'the left third of the frame calm and dark for copy. One small orange light marks the ring.' + STYLE, 1536, 1024),
'master-portrait': ('A glowing ring of blue light spinning in the dark like a precision instrument dial, seen slightly from above, luminous paths branching downward to small floating glass panels, '
'the upper third of the frame calm and dark for copy. One small orange light marks the ring.' + STYLE, 1024, 1536),
'master-square': ('A single glowing blue ring of light in the dark, a bright orange point on its rim, three luminous threads leaving the ring toward the lower right, the upper half of the frame dark and calm for copy.' + STYLE, 1024, 1024),
}
for name, (p, w, h) in SHOTS.items():
out = OUT / f'{name}.png'
if out.exists() and out.stat().st_size > 50000: print('skip', name); continue
for attempt in range(2):
r = subprocess.run([sys.executable, GEN, '--prompt', p, '--width', str(w), '--height', str(h), '--no-text', '--filename', str(out)], env=env, capture_output=True, text=True)
ok = out.exists() and out.stat().st_size > 50000
print(('ok ' if ok else 'FAIL') + ' ' + name, flush=True)
if ok: break
time.sleep(5)
print('DONE')