TPIPS โ Early Fusion (R1/R2 register tokens)
Text-conditioned perceptual image similarity, built on
Qwen/Qwen3-VL-Embedding-8B. This repo holds the
early_fusion checkpoint (one of three TPIPS models, each in its own repo โ see
the table at the bottom). Code and full docs: https://github.com/adobe-research/TPIPS.
Early fusion. (img0, img1, text) are encoded jointly with two register tokens R1 / R2 under a block-sparse attention mask. The pairwise score is cos(R1, R2) (symmetrized over both orderings) (higher = more similar).
Odd-one-out probabilities are a softmax over the three "other-pair" scores
divided by the temperature; 2AFC compares the two reference-candidate scores.
The pairwise score is the model's raw output (temperature is applied at the
probability step).
| Property | Value |
|---|---|
| Base model | Qwen/Qwen3-VL-Embedding-8B |
| Pairwise score | cos(R1, R2) (symmetrized over both orderings) |
| Fine-tuning | LoRA (r=64, ฮฑ=128) on the LLM layers; vision tower frozen |
| Register tokens | 2 (R1 sees text+img0; R2 sees text+img1) |
| Temperature | 0.05 (applied at the probability step) |
Prompt X |
Measure the similarity between the two images based on X. |
Usage
TPIPS supports Python 3.10 and later. Install matching PyTorch and torchvision builds from the official PyTorch installer, then install TPIPS:
pip install tpips
import tpips
from PIL import Image
model = tpips.load_model("early_fusion", device="cuda")
a = Image.open("a.jpg").convert("RGB")
b = Image.open("b.jpg").convert("RGB")
similarity = model.similarity(a, b, factor="lighting") # higher is more similar
distance = model.distance(a, b, factor="lighting") # lower is more similar
The first call downloads the selected TPIPS checkpoint and its Qwen backbone. A CUDA GPU is recommended; FlashAttention is optional.
The TPIPS models
| Model | Repo |
|---|---|
| Embedding (late fusion) | sywang/TPIPS-Embed-Qwen3VL-8B |
| Early Fusion | sywang/TPIPS-EarlyFusion-Qwen3VL-8B |
| Activation Distance | sywang/TPIPS-ActDiff-Qwen3VL-8B |
License
TPIPS is provided under the Adobe Research License for noncommercial research use. See the license for the complete terms.
- Downloads last month
- 10,576