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