Image-Text-to-Text
Transformers
Safetensors
qwen4_exp
reward-model
subject-consistency
checklist
vlm-judge
anonymous-submission
conversational
Instructions to use CodeZzz/r2i-test with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CodeZzz/r2i-test with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="CodeZzz/r2i-test") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("CodeZzz/r2i-test") model = AutoModelForMultimodalLM.from_pretrained("CodeZzz/r2i-test", device_map="auto") 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CodeZzz/r2i-test with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CodeZzz/r2i-test" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CodeZzz/r2i-test", "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/CodeZzz/r2i-test
- SGLang
How to use CodeZzz/r2i-test 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 "CodeZzz/r2i-test" \ --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": "CodeZzz/r2i-test", "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 "CodeZzz/r2i-test" \ --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": "CodeZzz/r2i-test", "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 CodeZzz/r2i-test with Docker Model Runner:
docker model run hf.co/CodeZzz/r2i-test
r2i-test: checklist consistency judge
Anonymous release accompanying a paper under double-blind review.
A vision-language judge for reference-to-image (subject-driven) generation.
Given a reference image, a generated image, and a task-specific preservation checklist,
it returns an item-level verdict (pass / fail / unjudgeable) and a verbal critique for each checklist item.
- Backbone: Qwen3.8-Flash-Next (
Qwen4ExpForConditionalGeneration), vision and language weights fine-tuned - Training: supervised fine-tuning on 286,048 human-annotated referenceโcandidate examples, 1 epoch (8,939 updates), peak LR 4e-6, cosine schedule
- Checkpoint: end of epoch 1
Consistency reward
r_cons = (n_pass + n_unjudgeable) / K = 1 - n_fail / K # K = checklist length
Inference
Serve with SGLang. Decoding settings: temperature=0, top_p=1, top_k=-1, max_new_tokens=1500.
inference/prompt.pybuilds the user message (rubric + checklist rendering, byte-identical to training).inference/contract.pyparses and validates the<answer>{...}</answer>JSON (schemar2i-checklist-judge-output-v1, fieldsid/status/desc).
Files
model-*.safetensors(505 shards),model.safetensors.index.json, config / tokenizer / processor filesinference/prompt.py,inference/contract.pyLICENSE: license of the backbone model, which this derivative follows
- Downloads last month
- -