Instructions to use xiaokuixk/PortraitCraft-Track1-sky with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xiaokuixk/PortraitCraft-Track1-sky with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="xiaokuixk/PortraitCraft-Track1-sky") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("xiaokuixk/PortraitCraft-Track1-sky") model = AutoModelForImageTextToText.from_pretrained("xiaokuixk/PortraitCraft-Track1-sky") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use xiaokuixk/PortraitCraft-Track1-sky with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "xiaokuixk/PortraitCraft-Track1-sky" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xiaokuixk/PortraitCraft-Track1-sky", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/xiaokuixk/PortraitCraft-Track1-sky
- SGLang
How to use xiaokuixk/PortraitCraft-Track1-sky with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "xiaokuixk/PortraitCraft-Track1-sky" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xiaokuixk/PortraitCraft-Track1-sky", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "xiaokuixk/PortraitCraft-Track1-sky" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xiaokuixk/PortraitCraft-Track1-sky", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use xiaokuixk/PortraitCraft-Track1-sky with Docker Model Runner:
docker model run hf.co/xiaokuixk/PortraitCraft-Track1-sky
PortraitCraft Track-1 — Qwen3.5-4B-VL Fine-tuned
A 4B vision-language model fine-tuned for portrait composition aesthetic assessment, submitted to the CVPR 2026 Workshop PortraitCraft Challenge Track-1.
The model jointly predicts:
- 13 fine-grained aesthetic criteria (each as a continuous 0-10 score)
- An overall aesthetic score (integer 1-100)
- A 4-way multiple-choice VQA answer
All three are emitted in a single strict-JSON output.
Quick start
pip install -r inference/requirements.txt
# Run inference on the official Track-1 test set:
bash run_inference.sh \
/path/to/track_1_test.json \
/path/to/PortraitCraft # directory containing images_00/ images_01/ ...
This produces submission.json and submission.zip in the repo root.
Inference
The pipeline at inference time uses 2-pass test-time augmentation:
- Standard resolution (
max_pixels=1003520) + original image - Standard resolution + horizontally flipped
- High resolution (
max_pixels=2007040) + original - High resolution + flipped
The continuous criterion scores from all four passes are averaged, and only then mapped to discrete levels by fixed thresholds (<5→A, 5-7→B, ≥7→C). The VQA answer is taken from the standard-resolution original pass.
Output schema
{
"image_path": "...",
"criteria": {
"Color Harmony": {"level": "A|B|C"},
"Visual Style Consistency": {"level": "A|B|C"},
"Sharpness": {"level": "A|B|C"},
"Light and Shadow Modeling": {"level": "A|B|C"},
"Creativity and Originality": {"level": "A|B|C"},
"Exposure Control": {"level": "A|B|C"},
"Application of Classical Composition Principles": {"level": "A|B|C"},
"Depth of Field and Layering": {"level": "A|B|C"},
"Visual Center Stability": {"level": "A|B|C"},
"Visual Flow Guidance": {"level": "A|B|C"},
"Structural Support Stability": {"level": "A|B|C"},
"Appropriateness of Negative Space": {"level": "A|B|C"},
"Subject Integrity": {"level": "A|B|C"}
},
"total_score": 65,
"question": "...",
"options": {"A": "...", "B": "...", "C": "...", "D": "..."},
"answer": "A|B|C|D"
}
Environment
Pinned versions for reproducibility (see inference/requirements.txt):
| Package | Version |
|---|---|
| vllm | 0.19.1 |
| transformers | 5.5.4 |
| torch | 2.10.0 (CUDA 12.x) |
| Pillow | 11.3.0 |
For best reproduction we recommend running on NVIDIA H20 GPUs (matching the training/inference setup).
License
Apache 2.0 (inherited from the Qwen3.5-4B-VL base model).
Citation
If you use this model, please cite the PortraitCraft challenge and the Qwen3.5 base model.
- Downloads last month
- 45