--- pipeline_tag: text-to-image tags: - text-to-image - svg - vector-graphics license: mit --- # Diffsketcher - Vector Graphics Generation This model generates vector graphics (SVG) from text prompts. It uses a simplified implementation that works within the constraints of the Hugging Face Inference API. ## Model Description DiffSketcher generates vector graphics (SVG) from text prompts. It uses a diffusion model to guide the SVG generation. ## Usage ```python import requests API_URL = "https://api-inference.huggingface.co/models/jree423/diffsketcher" headers = {"Authorization": "Bearer YOUR_API_TOKEN"} def query(prompt): response = requests.post(API_URL, headers=headers, json={"inputs": prompt}) return response.content # Returns the image directly # Generate an image with open("output.png", "wb") as f: f.write(query("a red sports car")) ``` ## Examples - "a red sports car" - "a blue sedan" - "a black SUV" - "a yellow convertible" ## Limitations This is a simplified implementation that: - Primarily generates car-like SVG images - Uses CLIP for text encoding when available - Doesn't require downloading large model weights ## Citation ``` @article{xing2023diffsketcher, title={{DiffSketcher}: Text Guided Vector Sketch Synthesis through Latent Diffusion Models}, author={Xing, XiMing and Zhan, Chuang and Xu, Yinghao and Dong, Yue and Yu, Yingqing and Li, Chongyang and Liu, Yongyi and Ma, Chongxuan and Tao, Dacheng}, journal={arXiv preprint arXiv:2306.14685}, year={2023} } ``` ## License This model is licensed under the MIT License.