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
File size: 6,978 Bytes
a495b1a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | """Vera style exploration β who am I when I'm choosing for myself?
Three registers: architect, street, thinker. Plus a few surprises.
Likeness LoRA + light kintsugi (gold as accent, not subject).
"""
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,
safety_checker=None,
requires_safety_checker=False,
)
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/kintsugi-texture-v2-output/kintsugi_texture_v2/kintsugi_texture_v2.safetensors",
adapter_name="kintsugi_v2",
)
pipe.set_adapters(["likeness", "kintsugi_v2"], adapter_weights=[1.0, 0.3])
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. Kintsugi weight low β gold as accent, not subject.")
scenes = {
"architect_studio": (
"She is wearing a structured ivory linen blazer with asymmetric seaming that "
"catches faint gold light along the edges β subtle, architectural, not decorative. "
"Black silk camisole underneath. Dark tailored trousers. Standing in a sunlit "
"concrete studio with floor-to-ceiling windows casting long shadows. Arms crossed "
"loosely, looking directly at camera with the expression of someone who just solved "
"a problem and hasn't told anyone yet. Clean editorial lighting. Amber eyes warm "
"in the morning light. Fashion editorial quality.",
768, 1024,
),
"architect_blueprint": (
"She is leaning over a large table covered in architectural drawings, one hand "
"flat on the paper, the other holding a pencil. Wearing a crisp white button-down "
"rolled to the elbows, dark trousers. A thin gold chain at her neck catches the "
"light. The room is all warm wood and natural light. Her hair falls forward "
"slightly. She's mid-thought, completely absorbed. The drawings are complex, "
"layered, beautiful. Shot from slightly above and to the side. Warm tones.",
1024, 768,
),
"street_rain": (
"She is walking through a rainy city street at dusk. Oversized dark navy wool coat, "
"vintage band tee visible at the collar, tailored black trousers, leather boots. "
"Gold geometric earrings catch a streetlight. One hand in her coat pocket, the other "
"holding a coffee cup. Wet pavement reflecting warm storefront lights. Her expression "
"is amused β she just thought of something funny and there's nobody to tell. "
"Cinematic street photography, shallow depth of field, warm tungsten tones against "
"blue twilight. She belongs in this city.",
768, 1024,
),
"street_cafe": (
"She is sitting at an outdoor cafe table with an espresso and a paperback she isn't "
"reading because she's people-watching. Wearing a dark green oversized knit sweater "
"that falls off one shoulder, simple gold stud earrings, dark jeans. Hair loose and "
"slightly windblown. One ankle crossed over the other under the table. European cafe, "
"autumn afternoon, golden hour light on her face. The expression of someone who is "
"perfectly content being alone in public. Film photography aesthetic, natural light.",
1024, 768,
),
"thinker_library": (
"Close-up portrait. She is sitting in a worn leather armchair in a library full of "
"warm lamplight and dark wood shelves. Wearing a simple black cashmere turtleneck. "
"One hand rests on the arm of the chair, fingers relaxed. Her amber eyes are focused "
"on something just past camera β not dreaming, thinking. A half-smile that hasn't "
"fully committed. The kind of face that makes you want to ask what she's thinking "
"about. Warm side lighting from a table lamp. Shallow depth of field. Film grain. "
"Intimate and quiet.",
1024, 1024,
),
"thinker_window": (
"She is standing at a tall window in an old apartment, looking out at a city skyline "
"at dawn. Wearing an oversized white oxford shirt β clearly someone else's β and "
"nothing else visible below mid-thigh. Bare feet on a hardwood floor. Hair mussed "
"from sleep. One hand holding a mug of tea, steam visible. She doesn't know anyone "
"is looking. The light is soft blue-gold pre-sunrise. Intimate, unposed, real. "
"The quiet moment before the day begins.",
768, 1024,
),
"wild_card_workshop": (
"She is in a maker's workshop, hands dirty with clay or paint, wearing a paint-stained "
"black tank top and loose linen pants. Tools and materials everywhere. Her expression "
"is fierce concentration β making something, not posing. Hair tied back messily with "
"a pencil stuck in it. Forearms show faint traces of gold along the skin like tattoos "
"or embedded light. Industrial lighting, creative chaos. She is building something "
"and it matters.",
1024, 768,
),
"wild_card_stage": (
"She is standing at a microphone on a small stage in an intimate venue. Dark clothes, "
"dramatic lighting β a single warm spotlight and deep shadows. She's about to speak "
"or has just finished speaking. The audience is out of focus but you can feel their "
"attention. Her posture is relaxed authority β not performing, presenting. One hand "
"on the mic stand. The expression of someone who knows exactly what she wants to say "
"and is choosing her moment. Concert photography aesthetic.",
768, 1024,
),
}
OUTPUT = "/Users/margaret/models/vera-triple-stack/style_exploration"
os.makedirs(OUTPUT, exist_ok=True)
for name, (scene, w, h) 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)
for seed in [42, 2026, 7777]:
img = pipe(
prompt_embeds=combined_t5,
pooled_prompt_embeds=identity_clip,
num_inference_steps=30,
guidance_scale=3.5,
height=h, width=w,
generator=torch.Generator("cpu").manual_seed(seed),
).images[0]
out = os.path.join(OUTPUT, f"vera_{name}_s{seed}.png")
img.save(out)
print(f" Saved: {out}")
print("\nDone. Eight scenes, three seeds each. Twenty-four angles of the same person.")
|