Views
No views yet
| Path | Contents |
|---|---|
shopify/final/{image_proj_model,ip_attn_processors}.pt | Shopify checkpoint @ step 3000 |
shopify/train.log | Shopify val-loss per 250 steps |
etsy/final/{image_proj_model,ip_attn_processors}.pt | Etsy checkpoint @ step 3000 |
etsy/checkpoint-500/{image_proj_model,ip_attn_processors}.pt | Recommended Etsy checkpoint — best val loss, before mild overfit |
etsy/train.log | Etsy val-loss per 250 steps |
ebay/final/{image_proj_model,ip_attn_processors}.pt | eBay checkpoint @ step 3000 |
ebay/train.log | eBay val-loss per 250 steps |
IPAdapterSDXL.save_pretrained format defined in adapters/ip_adapter/model.py. Two files per checkpoint: image_proj_model.pt (CLIP-embed → token projection) and ip_attn_processors.pt (injected K/V weights for every cross-attention block of the SDXL UNet).1from huggingface_hub import snapshot_download
2
3# Full set (~5.6 GB)
4snapshot_download(
5 repo_id="jasonshen8848/StudioDiffusion-ip-adapter",
6 local_dir="checkpoints/ip_adapter",
7)
8
9# Single platform (~1.4 GB)
10snapshot_download(
11 repo_id="jasonshen8848/StudioDiffusion-ip-adapter",
12 local_dir="checkpoints/ip_adapter",
13 allow_patterns=["shopify/final/*", "shopify/train.log"],
14)inference/smoke.py. Core pattern:1import torch
2from diffusers import StableDiffusionXLPipeline, AutoencoderKL
3from PIL import Image
4from torchvision import transforms
5
6from adapters.ip_adapter.model import IPAdapterSDXL # from the GitHub repo
7
8device, dtype = "mps", torch.float16 # also works on CUDA with these
9
10pipe = StableDiffusionXLPipeline.from_pretrained(
11 "stabilityai/stable-diffusion-xl-base-1.0",
12 vae=AutoencoderKL.from_pretrained(
13 "madebyollin/sdxl-vae-fp16-fix", torch_dtype=dtype,
14 ),
15 torch_dtype=dtype,
16).to(device)
17
18adapter = IPAdapterSDXL.load_pretrained(
19 unet=pipe.unet,
20 load_directory="checkpoints/ip_adapter/shopify/final",
21 image_encoder_id="openai/clip-vit-large-patch14-336",
22 num_tokens=16,
23 adapter_scale=1.0,
24).to(device=device, dtype=dtype)
25
26clip_transform = transforms.Compose([
27 transforms.Resize(336, interpolation=transforms.InterpolationMode.BICUBIC),
28 transforms.CenterCrop(336),
29 transforms.ToTensor(),
30 transforms.Normalize(
31 mean=[0.48145466, 0.4578275, 0.40821073],
32 std=[0.26862954, 0.26130258, 0.27577711],
33 ),
34])
35
36ref = Image.open("my_product.jpg").convert("RGB")
37clip_input = clip_transform(ref).unsqueeze(0).to(device=device, dtype=dtype)
38with torch.no_grad():
39 cond_ip, uncond_ip = adapter.encode_image(clip_input)
40ip_hidden_states = torch.cat([uncond_ip, cond_ip], dim=0) # [uncond, cond] for CFG
41
42image = pipe(
43 prompt="a professional product photograph",
44 negative_prompt="blurry, low quality, distorted, artifacts",
45 num_inference_steps=30,
46 guidance_scale=7.5,
47 height=512, width=512,
48 cross_attention_kwargs={"ip_hidden_states": ip_hidden_states},
49).images[0]
50image.save("out.png")| Shopify | Etsy | eBay | |
|---|---|---|---|
| Train images | 353 | 325 | 518 |
| Val images | 88 | 81 | 129 |
| Start val loss (step 250) | 0.073747 | 0.131454 | 0.058868 |
| End val loss (step 3000) | 0.072500 | 0.132335 | 0.055920 |
| Best val loss | 0.072463 @ step 2000 | 0.131412 @ step 750 | 0.055920 @ step 3000 |
| Δ val loss | −1.7% ↓ | +0.7% ↑ (mild overfit) | −5.0% ↓ |
| Wall-clock | ~9 h | ~9 h | ~9 h |
stabilityai/stable-diffusion-xl-base-1.0madebyollin/sdxl-vae-fp16-fixopenai/clip-vit-large-patch14-336 (frozen)data/curate_platform.py in the companion repo. Sources: Amazon Berkeley Objects (ABO), LAION-Aesthetics, DeepFashion2. ~400 images per platform selected by CLIP platform-prompt similarity + category balancing; 80/20 train/val split recorded in manifest CSVs."a product photo" for every sample (BLIP-2 caption generation was deferred). Text conditioning therefore provides minimal per-sample variance; all platform aesthetic signal flows through the IP-Adapter image branch.adapter_scale=0.5–0.75 at inference.final/ checkpoint is stylistically the strongest but diverges more from the reference content. For content-preserving generation, prefer etsy/checkpoint-500/ (closest available to the val-loss optimum).NDArrayMatrixMultiplication assertion on the first forward pass. These weights are architecturally compatible with fp16 inference (verified on MPS — see the example above), but fp16 / bf16 training of this adapter configuration on CUDA has not been tested here.1@misc{studiodiffusion2026,
2 title = {StudioDiffusion: Training Platform-Specific Aesthetic Adapters for Product
3 Photography Using Segmentation-Conditioned Diffusion Models},
4 author = {Shen, Jason and contributors},
5 year = {2026},
6 howpublished = {\url{https://github.com/s-zx/StudioDiffusion}},
7 note = {CS 7643 Deep Learning final project, Georgia Tech}
8}