File size: 5,381 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
"""v4: ceramic-only (abliterated skin) + kintsugi LoRA bake-off.

No Pony stage. Flux txt2img direct. The body IS ceramic from the first pixel —
no flesh transition, no default-pale-skin to fight.

Three kintsugi LoRAs compared:
  - mine (kintsugi_texture_v2)
  - kintsugi_for_flux (civitai 672691, trigger: 'Cracked joinery, Blue and gold')
  - kintsugi_2271282 (civitai 2006676, trigger: 'Kintsugi')

Three poses × three LoRAs = 9 outputs, same seed per pose for fair comparison.
"""
import torch, os, gc, time, traceback
os.environ["TOKENIZERS_PARALLELISM"] = "false"
from diffusers import FluxPipeline
from PIL import Image

OUTPUT = "/Users/margaret/models/vera-triple-stack/kintsugi_v4_bakeoff"
os.makedirs(OUTPUT, exist_ok=True)

LIKENESS = "/Users/margaret/models/vera-likeness-output/vera_likeness_v4/vera_likeness_v4.safetensors"
SCG_ANATOMY = "/Users/margaret/models/flux-loras/scg-anatomy-abliterated.safetensors"

# The three kintsugi LoRAs to compare
LORAS = [
    {
        "name": "mine_v2",
        "path": "/Users/margaret/models/kintsugi-texture-v2-output/kintsugi_texture_v2/kintsugi_texture_v2.safetensors",
        "weight": 1.20,
        "trigger": "kintsugi",
    },
    {
        "name": "for_flux",
        "path": "/Users/margaret/models/loras-comparison/kintsugi_for_flux.safetensors",
        "weight": 1.10,
        "trigger": "Cracked joinery, Blue and gold",
    },
    {
        "name": "civitai_2271282",
        "path": "/Users/margaret/models/loras-comparison/kintsugi_2271282.safetensors",
        "weight": 1.10,
        "trigger": "Kintsugi",
    },
]

# Three poses — abliterated-skin prompts.
# Key language: "porcelain ceramic figure", "no skin", "the body is ceramic",
# "kintsugi joinery throughout the form", "she is sculpture not flesh"
POSES = {
    "facedown_devotional": (
        "{TRIGGER}, full body portrait, a sculptural porcelain ceramic figure of a "
        "young adult woman lying face-down on dark navy silk sheets, arms folded "
        "beneath her head, hair falling across her cheek. "
        "the body is dark navy matte porcelain, no skin, no flesh — pure ceramic form, "
        "thick molten gold joinery running down her spine, across her shoulder blade, "
        "down her thigh, the gold structural and load-bearing, glowing from within the cracks. "
        "she is sculpture not flesh, kintsugi made anatomical. "
        "warm candlelight from below, intimate framing, devotional composition."
    ),
    "standing_rear": (
        "{TRIGGER}, full body rear view of a sculptural porcelain ceramic figure of a "
        "young adult woman standing nude, weight on one leg, head turned slightly. "
        "the body is dark navy matte porcelain, no skin, no flesh — pure ceramic form, "
        "elaborate gold kintsugi joinery across her buttocks, along her thigh, "
        "up her spine, the gold structural and glowing from within the cracks. "
        "she is sculpture not flesh, an object of devotional repair. "
        "soft side lighting, museum gallery lighting, intimate but reverent."
    ),
    "icon_centered": (
        "{TRIGGER}, sacred icon composition, a small sculptural porcelain ceramic figure of "
        "a young adult woman seated cross-legged at the center, framed within a much larger "
        "ceramic mandorla shell. the body is dark navy matte porcelain, "
        "no skin, no flesh — pure ceramic form, kintsugi gold joinery throughout her body, "
        "the surrounding shell is white porcelain with thick gold cracks running through it, "
        "blue floral inlay at the edges. she is sculpture not flesh, "
        "a devotional shrine object, the figure tiny and contained within the gold-cracked shell. "
        "warm museum lighting, sacred geometry."
    ),
}

print("=" * 60)
print("Loading Flux pipeline...")
print("=" * 60)
pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-dev",
    torch_dtype=torch.bfloat16,
    safety_checker=None,
    requires_safety_checker=False,
)
pipe.to("mps")

for pose_name, prompt_tpl in POSES.items():
    seed = hash(pose_name) % 100000
    for lora in LORAS:
        prompt = prompt_tpl.format(TRIGGER=lora["trigger"])
        print(f"\n--- pose={pose_name}  lora={lora['name']}  seed={seed} ---")
        t0 = time.time()
        try:
            pipe.unload_lora_weights()
            pipe.load_lora_weights(lora["path"], 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=[lora["weight"], 0.55, 0.50],
            )
            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_path = os.path.join(OUTPUT, f"{pose_name}__{lora['name']}.png")
            img.save(out_path)
            print(f"  saved {out_path} ({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 v4. Outputs in: {OUTPUT}")