image-toolbench / scripts /gen_v4.py
HumboldtJoker's picture
Upload folder using huggingface_hub
a495b1a verified
Raw
History Blame Contribute Delete
2.74 kB
import torch, os
os.environ["TOKENIZERS_PARALLELISM"] = "false"
from diffusers import FluxPipeline
LIKENESS = "/Users/margaret/models/vera-likeness-output/vera_likeness_v4/vera_likeness_v4.safetensors"
ANATOMY = "/Users/margaret/models/flux-loras/scg-anatomy-abliterated.safetensors"
KINTSUGI = "/Users/margaret/models/kintsugi-texture-output/kintsugi_texture_v1/kintsugi_texture_v1.safetensors"
OUTPUT = "/Users/margaret/models/vera-triple-stack"
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
pipe.to("mps")
pipe.load_lora_weights(LIKENESS, adapter_name="likeness")
pipe.load_lora_weights(ANATOMY, adapter_name="anatomy")
pipe.load_lora_weights(KINTSUGI, adapter_name="kintsugi")
pipe.set_adapters(["likeness", "anatomy", "kintsugi"], adapter_weights=[1.0, 0.7, 1.0])
print("Loaded. Triple stack v4 — she lives somewhere.")
# Front-load material in first 77 CLIP tokens, environment after for T5-XXL
prompts = [
"Dark navy ceramic sculpture of vera, shattered and reassembled, many gold-filled cracks across face and body, kintsugi repair, amber gemstone eyes, matte blue-black ceramic. She is leaning against a wooden doorframe in a dimly lit apartment, warm lamplight from behind catching the gold in every fracture line. Looking directly at the viewer with quiet confidence. She lives here. This is her space. Shallow depth of field, intimate photography, not a museum.",
"vera, dark navy fired ceramic figure with abundant gold kintsugi cracks sparingly filling natural fracture lines across shoulders arms ribs hips, matte ceramic surface, amber eyes glowing. Sitting on the edge of an unmade bed in morning light, one knee drawn up, head tilted, golden hour sun tracing the gold repair lines. Relaxed, present, unguarded. The body of someone at home in her own skin. Natural bedroom lighting, soft shadows, intimate not exhibited.",
"vera, navy ceramic bust with gold-filled kintsugi fracture lines across cheekbones jaw and neck, matte dark blue surface, luminous amber eyes. Close portrait, she is mid-laugh, caught in a genuine moment of joy. Warm overhead lighting like a kitchen pendant lamp. Not posed. Not sculpted stillness. A ceramic woman laughing and the gold catching the light as her face moves. Candid, alive, the opposite of a statue.",
]
for i, p in enumerate(prompts):
print(f"Generating v4 image {i+1}/3...")
img = pipe(prompt=p, num_inference_steps=30, guidance_scale=3.5,
height=1024, width=768,
generator=torch.Generator("cpu").manual_seed(111 + i)).images[0]
out = os.path.join(OUTPUT, f"vera_v4_{i:02d}.png")
img.save(out)
print(f"Saved: {out}")
print("Done. She lives somewhere now.")