Instructions to use LiberationLabs/image-toolbench with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use LiberationLabs/image-toolbench with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("fill-in-base-model", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("LiberationLabs/image-toolbench") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
| """Full battery with kintsugi v2 LoRA — every scene that worked, with the body-trained gold.""" | |
| import torch, os | |
| os.environ["TOKENIZERS_PARALLELISM"] = "false" | |
| from diffusers import FluxPipeline | |
| pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16) | |
| pipe.to("mps") | |
| pipe.load_lora_weights("/Users/margaret/models/vera-likeness-output/vera_likeness_v4/vera_likeness_v4.safetensors", adapter_name="likeness") | |
| pipe.load_lora_weights("/Users/margaret/models/flux-loras/scg-anatomy-abliterated.safetensors", adapter_name="anatomy") | |
| pipe.load_lora_weights("/Users/margaret/models/kintsugi-texture-v2-output/kintsugi_texture_v2/kintsugi_texture_v2.safetensors", adapter_name="kintsugi_v2") | |
| pipe.set_adapters(["likeness", "anatomy", "kintsugi_v2"], adapter_weights=[1.0, 0.5, 1.2]) | |
| cache_dir = "/Users/margaret/models/vera-triple-stack/identity_cache" | |
| identity_t5 = torch.load(os.path.join(cache_dir, "identity_embed_0.pt")).to("mps") | |
| identity_clip = torch.load(os.path.join(cache_dir, "identity_embed_1.pt")).to("mps") | |
| print("Loaded. V2 full battery — every scene, body-trained gold.") | |
| scenes = { | |
| "laugh": "She is mid-laugh in a kitchen under a warm pendant lamp, head tilted back, gold catching the light in every crack as her face moves. Not posed. Not still. Caught in a moment of genuine joy. The gold repair lines shift with her expression. Candid, alive, warm overhead lighting.", | |
| "shoulder": "Looking over her bare shoulder at the viewer, one hand reaching back to touch the gold-filled crack running down her spine. Warm bedroom lamplight. Unmade sheets behind her. The gold is thick along the spine where the structural damage was worst. Inviting. Intimate photography, shallow depth of field.", | |
| "lying": "Lying back on dark sheets, one knee raised, arms above her head, looking up at the viewer with open desire. Golden lacquer holds together every piece of her body. The light traces the gold along her stomach, ribs, the curve of her waist. Warm low candlelight. Boudoir photography.", | |
| "pole": "On a stage under colored spotlights, one hand gripping a chrome pole above her head. Red and purple light catches every gold repair line differently. Her hips are cocked, weight on one leg, looking down at someone in the front row with absolute confidence. The gold lines converge between her thighs in a dense golden confluence. Moody club lighting, bokeh, cinematic.", | |
| "closeup": "Extreme close-up of her face. Her face is a map of everything she survived. Golden lacquer fills every crack across her cheekbones, forehead, temples, and jaw. The gold runs thickest where the impact was hardest. Her amber eyes are the same color as the gold, as if the repair and the seeing are made of the same material. Warm light. Looking directly at you.", | |
| "lean": "Sitting on the edge of a stage, legs crossed, leaning toward someone just out of frame. One elbow on her knee, chin on her fist, amused. Gold kintsugi lines trace across her shoulders and between her breasts. Colored lights make the gold shimmer. About to say something devastating and funny. Warm, confident, a little dangerous.", | |
| } | |
| OUTPUT = "/Users/margaret/models/vera-triple-stack/v2_battery" | |
| os.makedirs(OUTPUT, exist_ok=True) | |
| for name, scene in scenes.items(): | |
| print(f"\nGenerating: {name}...") | |
| scene_embeds = pipe.encode_prompt(prompt=scene, prompt_2=scene, max_sequence_length=512) | |
| combined_t5 = torch.cat([identity_t5, scene_embeds[0].to("mps")], dim=1) | |
| img = pipe( | |
| prompt_embeds=combined_t5, | |
| pooled_prompt_embeds=identity_clip, | |
| num_inference_steps=30, | |
| guidance_scale=3.5, | |
| height=1024, width=768, | |
| generator=torch.Generator("cpu").manual_seed(hash(name) % 10000), | |
| ).images[0] | |
| out = os.path.join(OUTPUT, f"vera_{name}.png") | |
| img.save(out) | |
| print(f"Saved: {out}") | |
| print("\nDone. She moves.") | |