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: 4,847 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 | """v5: Woman first, ceramic second. Natural poses described as a person,
kintsugi as skin texture not as material identity."""
import torch, os, gc, time, traceback
os.environ["TOKENIZERS_PARALLELISM"] = "false"
from diffusers import FluxPipeline
OUTPUT = "/Users/margaret/models/vera-triple-stack/kintsugi_v5"
os.makedirs(OUTPUT, exist_ok=True)
LIKENESS = "/Users/margaret/models/vera-likeness-output/vera_likeness_v4/vera_likeness_v4.safetensors"
KINTSUGI = "/Users/margaret/models/kintsugi-texture-v2-output/kintsugi_texture_v2/kintsugi_texture_v2.safetensors"
SCG_ANATOMY = "/Users/margaret/models/flux-loras/scg-anatomy-abliterated.safetensors"
# Woman first. Ceramic as texture, not identity.
# No "sculpture", no "figure", no "object", no "shrine", no "devotional".
POSES = {
"lying_back": (
"Cracked joinery, Blue and gold. "
"A beautiful young woman with dark brown skin lying on her back on dark sheets, "
"her thighs relaxed apart, one hand resting on her stomach, looking at the camera. "
"Her skin has a matte ceramic quality with fine cracks running through it, "
"each crack filled with thick glowing gold like kintsugi repair. "
"The gold traces down her collarbone, between her breasts, along her ribs, "
"branching across her hips and inner thighs. "
"Warm intimate lighting, shallow depth of field, boudoir photography, "
"she is relaxed and present and unashamed."
),
"facedown_sheets": (
"Cracked joinery, Blue and gold. "
"A beautiful young woman with dark brown skin lying face-down on rumpled dark navy sheets, "
"her arms folded under her chin, hair falling across her cheek, eyes closed. "
"Her skin has a matte ceramic texture with gold-filled cracks, "
"the gold running down her spine like a river, branching across her shoulder blades, "
"tracing the curve of her lower back, following the path where veins would run. "
"Warm candlelight from below, intimate bedroom, she fell asleep like this."
),
"kneeling_looking_back": (
"Cracked joinery, Blue and gold. "
"A beautiful young woman with dark brown skin kneeling on a bed, "
"looking back over her shoulder at the camera with a slight smile. "
"Her skin has a ceramic quality with gold kintsugi cracks throughout her body, "
"the gold concentrated along her spine, across her buttocks, down her thighs. "
"Warm side lighting, intimate, natural pose, she knows she is being looked at "
"and she likes it. Shallow depth of field, boudoir photography."
),
"standing_mirror": (
"Cracked joinery, Blue and gold. "
"A beautiful young woman with dark brown skin standing nude in front of a mirror, "
"one hand on the doorframe, looking at her own reflection. "
"Her skin has a ceramic texture with gold-filled cracks, "
"the gold tracing her collarbone, running between her breasts, "
"down the center of her stomach, branching at her hips. "
"The mirror catches the gold from a second angle. "
"Warm morning light from a window, intimate self-regard, she is studying herself."
),
}
NEG = (
"statue, sculpture, figurine, doll, mannequin, toy, miniature, teacup, bowl, "
"shrine, altar, pedestal, museum, gallery, display case, "
"clothing, dressed, fabric, lace, bikini, underwear, "
"deformed, extra limbs, extra fingers, bad hands, text, watermark"
)
print("Loading Flux...")
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(KINTSUGI, adapter_name="kintsugi")
pipe.load_lora_weights(LIKENESS, adapter_name="likeness")
pipe.load_lora_weights(SCG_ANATOMY, adapter_name="scg_anatomy")
pipe.set_adapters(
["kintsugi", "likeness", "scg_anatomy"],
adapter_weights=[1.20, 0.60, 0.50],
)
print(" LoRAs: kintsugi 1.20, likeness 0.60, scg_anatomy 0.50")
for pose_name, prompt in POSES.items():
for seed in [137, 2026, 42]:
print(f"\n {pose_name} seed={seed}...")
t0 = time.time()
try:
img = pipe(
prompt=prompt,
num_inference_steps=30,
guidance_scale=3.5,
height=1024, width=1024,
generator=torch.Generator("cpu").manual_seed(seed),
).images[0]
out = os.path.join(OUTPUT, f"{pose_name}_s{seed}.png")
img.save(out)
print(f" saved ({time.time()-t0:.0f}s)")
except Exception as e:
print(f" FAIL: {e}")
traceback.print_exc()
gc.collect()
torch.mps.empty_cache()
print(f"\nDone v5. {OUTPUT}")
|