Enlightening Photographic Style Transfer with a Self-Supervised Photographic Embedding

Chengxuan Zhu* · Jiacong Fang* · Shuchen Weng · Youwei Lyu · Jiajun Tang · Qingnan Fan · Chao Xu · Boxin Shi

*: Equal Contribution

Project Page Paper Hugging Face License

Photographic style — the nuanced play of lightness, color, and tone a photographer crafts — is easy for the eye to read, yet invisible to most image embeddings. We present PETAL (Photographic Embedding for Transfer with an Adaptive LUT): we learn a continuous photographic embedding by self-supervision, and use it to drive a lightweight adaptive neural LUT that transfers style faithfully, with no test-time optimization.

Quick Start

1. Environment Setup

# A CUDA GPU is strongly recommended; CPU inference also works but is much slower.

# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh

uv sync         # Create the virtual environment and install dependencies

2. Download Checkpoints

The released weights are ckpts/style_encoder.pt and ckpts/lut_model.pt in this repository. To fetch them into a local ./ckpts folder, clone the code repository and run its download helper:

./download_weights.sh

You can also download the two files from the Files tab and place them in ./ckpts.

3. Inference

Content images and style images are paired by file stem (filename without extension): content_dir/001.jpg is paired with style_dir/001.png.

uv run python infer.py \
    --content_dir ./data/test_pairs/content \
    --style_dir ./data/test_pairs/reference \
    --output_dir ./outputs \
    --output_format png
Argument Default Description
--content_dir (required) Directory of content images
--style_dir (required) Directory of style images
--output_dir ./outputs Output directory
--lut_model_path ./ckpts/lut_model.pt Path to LUT / AdaIN checkpoint
--style_model_path ./ckpts/style_encoder.pt Path to style encoder checkpoint
--style_input_size 512 Resolution for the style encoder
--guidance_scale 1.0 Guidance scale for adain, suggested range [0.5, 1.2]
--mixed_precision no no / fp16 / bf16
--output_format png png / jpg / jpeg (PNG is lossless; JPG/JPEG are lossy)
--skip_existing off Skip pairs whose output already exists
--seed 42 Random seed

Citation

@inproceedings{zhu2026photographic,
  title     = {Enlightening Photographic Style Transfer with a Self-Supervised Photographic Embedding},
  author    = {Zhu, Chengxuan and Fang, Jiacong and Weng, Shuchen and Lyu, Youwei and Tang, Jiajun and Fan, Qingnan and Xu, Chao and Shi, Boxin},
  booktitle = {Proceedings of the European Conference on Computer Vision},
  year      = {2026}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support