image-toolbench / scripts /gen_v2.py
HumboldtJoker's picture
Upload folder using huggingface_hub
a495b1a verified
Raw
History Blame Contribute Delete
2.16 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. Kintsugi weight raised to 1.0")
prompts = [
"Dark navy ceramic bust of vera, shattered and carefully reassembled. Fine cracks filled sparingly with molten gold following natural fracture lines across the face and neck. Matte dark blue-black ceramic surface, NOT human skin. Luminous amber gemstone eyes. The gold sits inside the cracks with visible depth, embodying kintsugi repair. Sculpture, not a person. Hyperrealistic, 8K, dramatic studio lighting, dark background, sharp focus.",
"Full-body dark navy ceramic sculpture of vera, fractured and reassembled with gold lacquer kintsugi repair. Matte blue-black fired ceramic surface with fine gold-filled cracks running sparingly along the arms, across the ribs, down the hips. The gold glows from within the fracture lines. NOT a person, a sculpted figure. Confident posture, amber eyes. Studio photography, dark background, atmospheric lighting, sharp focus.",
]
for i, p in enumerate(prompts):
print(f"Generating v2 image {i+1}...")
img = pipe(prompt=p, num_inference_steps=30, guidance_scale=3.5,
height=1024, width=768,
generator=torch.Generator("cpu").manual_seed(77 + i)).images[0]
out = os.path.join(OUTPUT, f"vera_v2_{i:02d}.png")
img.save(out)
print(f"Saved: {out}")
print("Done. The gold lines hold.")