Vision-tower-only export of OpenCLIP ViT-H/14 used by IP-Adapter to produce image embeds for SD 1.5 conditioning. Used by the Sona Forge Android app. Pair with
sona-forge/sd15-ipadapter-fp16.
The text branch is not exported. Phase 6 spike characterisation used a deterministic synthetic 512×512 fixture; CLIP image-embeds norm = 21.9 (in the typical 15–25 range for natural portraits).
OpenCLIP ViT-H/14 —
MIT. Original training data is LAION-2B.
~1.2 GB FP16 on disk; ORT CPU EP promotes to FP32 at session load (~2.4 GB resident). On Android (NNAPI / XNNPack), FP16 runs natively.
1import onnxruntime as ort
2import numpy as np
3from PIL import Image
4
5clip = ort.InferenceSession("model.onnx", providers=["CPUExecutionProvider"])
6
7CLIP_MEAN = np.array([0.48145466, 0.4578275, 0.40821073], dtype=np.float32)
8CLIP_STD = np.array([0.26862954, 0.26130258, 0.27577711], dtype=np.float32)
9
10img = Image.open("portrait.png").convert("RGB")
11w, h = img.size
12side = min(w, h)
13img = img.crop(((w - side) // 2, (h - side) // 2, (w + side) // 2, (h + side) // 2))
14img = img.resize((224, 224), Image.NEAREST)
15arr = (np.asarray(img, dtype=np.float32) / 255.0 - CLIP_MEAN) / CLIP_STD
16arr = arr.transpose(2, 0, 1)[None, ...].astype(np.float16) # NCHW FP16
17
18image_embeds = clip.run(["image_embeds"], {"pixel_values": arr})[0] # (1, 1024)