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
| 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.") | |