Downloads · 30 days
21
26% of all-time downloads
deepglugs/qwen3-vl-flux2-8b
qwen3-vl-flux2-8b is a machine learning model from deepglugs. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Fine-tuned on 20k image-flux.2 dev JSON pairs.
Downloads · 30 days
21
26% of all-time downloads
All-time downloads
82
Public
Parameters
8.8B
17.5 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors17.5 GB · 100%
From the Hugging Face model README
Fine-tuned on 20k image-flux.2 dev JSON pairs.
from transformers import Qwen3VLForConditionalGeneration, AutoProcessor
import torch
model = Qwen3VLForConditionalGeneration.from_pretrained("deepglugs/qwen3-vl-flux2-8b", torch_dtype=torch.bfloat16, device_map="auto")
processor = AutoProcessor.from_pretrained("deepglugs/qwen3-vl-flux2-8b")
# ... your inference code
# Load your image
image_path = "path/to/your/image.png"
image = Image.open(image_path).convert("RGB")
# Use the special flux.2 prompt
messages = [
{
"role": "user",
"content": [
{"type": "image"},
{"type": "text", "text": "Describe this image in the flux.2 JSON format."}
]
}
]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = processor(text=[text], images=[image], return_tensors="pt").to("cuda")
# Generate (use temperature for slight variation if desired)
generated_ids = model.generate(
**inputs,
max_new_tokens=1024,
do_sample=True,
temperature=0.7,
top_p=0.9,
)
generated_text = processor.batch_decode(generated_ids[:, inputs.input_ids.shape[-1]:], skip_special_tokens=True)[0]
# Parse and pretty-print the JSON output
try:
json_output = json.loads(generated_text)
print(json.dumps(json_output, indent=2))
except json.JSONDecodeError:
print("Raw output (JSON parsing failed):")
print(generated_text)