Downloads · 30 days
46
8% of all-time downloads
orubilla/iconshop-svg-generator
iconshop-svg-generator is a text generation model from orubilla. Use it when you need the model to write or continue text. It is set up for pytorch. The card lists the license as cc-by-nc-sa-4.0.
⚠️ ALPHA / RESEARCH PREVIEW — NOT PRODUCTION READY This is alpha work. It is not production ready. This model is published as a starting point for people who want to get into the business of model training. The output…
Downloads · 30 days
46
8% of all-time downloads
All-time downloads
551
Public
Parameters
123M
556 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors493 MB · 89%
How the weights are stored.
F32123M · 100%
From the Hugging Face model README
⚠️ ALPHA / RESEARCH PREVIEW — NOT PRODUCTION READY
This is alpha work. It is not production ready. This model is published as a starting point for people who want to get into the business of model training. The output quality is inconsistent, and you should expect broken or malformed SVGs. Treat this as an educational/demo artifact — not something to ship.
A custom autoregressive transformer model that generates SVG icons from text descriptions.
| Prompt | Generated SVG |
|---|---|
star | <img src="samples/star.png" width="120"/> |
calendar | <img src="samples/calendar.png" width="120"/> |
car | <img src="samples/car.png" width="120"/> |
heart | <img src="samples/heart.png" width="120"/> |
rocket | <img src="samples/rocket.png" width="120"/> |
house | <img src="samples/house.png" width="120"/> |
animal | <img src="samples/animal.png" width="120"/> |
This model is trained on the FIGR-8-SVG dataset using the IconShop architecture - an autoregressive transformer that predicts SVG vector commands token-by-token, conditioned on a text prompt.
Architecture:
Training:
pip install torch transformers safetensors deepsvg cairosvg
from huggingface_hub import hf_hub_download
import torch
from transformers import AutoTokenizer
# Download model files
model_path = hf_hub_download("m1357l/iconshop-svg-generator", "model.safetensors")
config_path = hf_hub_download("m1357l/iconshop-svg-generator", "config.json")
word_emb_path = hf_hub_download("m1357l/iconshop-svg-generator", "word_embedding_512.pt")
# Load model
from model.decoder import SketchDecoder
import json
with open(config_path) as f:
config = json.load(f)
tokenizer = AutoTokenizer.from_pretrained("google/bert_uncased_L-12_H-512_A-8")
model = SketchDecoder(
config={
'hidden_dim': config['hidden_dim'],
'embed_dim': config['embed_dim'],
'num_layers': config['num_layers'],
'num_heads': config['num_heads'],
'dropout_rate': config['dropout_rate'],
},
pix_len=config['pix_len'],
text_len=config['text_len'],
num_text_token=tokenizer.vocab_size,
word_emb_path=word_emb_path,
pos_emb_path=config['pos_emb_path'],
)
# Load weights
from safetensors.torch import load_file
state_dict = load_file(model_path)
model.load_state_dict(state_dict, strict=False)
model.eval()
# Single prompt
python model_card.py --output ./samples --prompts "star"
# Multiple prompts
python model_card.py --output ./samples --prompts "star" "calendar" "car"
This model was trained using michellacle/IconShop — a fork of the original IconShop repository with training scripts, inference tools, and GPU setup for multi-GPU configurations. Check it out if you want to train your own IconShop model.
This model is based on the IconShop architecture and trained on the FIGR-8-SVG dataset. Please cite the original work if you use this model:
IconShop: Ronghuan Wu, Wanchao Su, Kede Ma, Jing Liao. "IconShop: Text-Guided Vector Icon Synthesis with Autoregressive Transformers." ACM Transactions on Graphics (TOG), Vol. 42, No. 6, Article 230, December 2023. arXiv:2304.14400
FIGR-8-SVG Dataset: Louis Clouâtre, Marc Demers. "FIGR: Few-shot Image Generation with Reptile." arXiv preprint arXiv:1901.02199, 2019. arXiv:1901.02199
CC BY-NC-SA 4.0 (Creative Commons Attribution-NonCommercial-ShareAlike 4.0)
This model is trained on the FIGR-8-SVG dataset, whose images are licensed under CC BY 3.0 (attribution required, commercial use prohibited). The original IconShop code repository has no explicit license. Therefore, this model is released under CC BY-NC-SA 4.0 to respect the original dataset's non-commercial terms.