SVG-Motion-Qwen3.5-0.8B-LoRA
SVG Animation Adapter
2 min readupdated
This compact PEFT adapter (a small add-on over a base model for fine-tuning) adds native animation code to existing SVG artwork based on text instructions. Built on Qwen/Qwen3.5-0.8B, the model takes vector source code and a text task as input, outputting a ready-to-use animated SVG with animate or animateTransform tags. The solution operates at the text level without generating pixels or video, preserving the original elements and structure of the source file. The model is useful for developers and designers who need to automate adding simple movements to vector graphics.
Key features
- Text-to-code: generates valid animation tags directly inside the structure of the SVG file.
- Broad movement coverage: supports translation, rotation, scaling, and opacity changes.
- Structure preservation: original tags, identifiers, and drawing attributes remain unchanged.
- Targeted training: employs a LoRA rank of 16 and trains about 10.8 million parameters.
What you can do
- Automate adding flips, scaling, or rotation animations to vector icons and illustrations.
- Integrate the adapter into a graphics processing pipeline for batch generation of animated UI SVG elements.
- Test animation generation for web projects and dynamic icons via Python scripts.
Example
import json
import torch
from huggingface_hub import hf_hub_download
from peft import PeftModel
from transformers import AutoTokenizer, Qwen3_5ForConditionalGeneration
adapter_id = "lxyuan/SVG-Motion-Qwen3.5-0.8B-LoRA"
base = Qwen3_5ForConditionalGeneration.from_pretrained(
"Qwen/Qwen3.5-0.8B", revision="2fc06364715b967f1860aea9cf38778875588b17",
dtype=torch.float32, attn_implementation="sdpa",
).to("cuda")
model = PeftModel.from_pretrained(base, adapter_id).eval()
tokenizer = AutoTokenizer.from_pretrained(adapter_id)Read more
DetailsBenchmarks: 100/100 successfully passed synthetic tests compared to 0/100 for the base model.
Hardware requirements: training was performed on a Tesla T4 GPU with a peak VRAM consumption of 5.00 GiB.
Training details: 100 optimization steps, batch size of 1 with gradient accumulation of 4, learning rate of 1e-4, AdamW.
Limitations: synthetic tasks with fixed rule formulations, generated code requires sandboxed validation.










Comments