jree423 commited on
Commit
ee7ff50
·
verified ·
1 Parent(s): 4eb5b6e

Update: Add model card for simplified implementation

Browse files
Files changed (1) hide show
  1. README.md +41 -29
README.md CHANGED
@@ -1,22 +1,19 @@
1
  ---
2
- license: mit
3
- tags:
4
- - text-to-image
5
- - svg
6
- - vector-graphics
7
  pipeline_tag: text-to-image
8
- widget:
9
- - text: "a beautiful mountain landscape"
10
- example_title: "Mountain Landscape"
11
- - text: "a cute cat sitting on a windowsill"
12
- example_title: "Cat on Windowsill"
13
- - text: "a futuristic city skyline at sunset"
14
- example_title: "Futuristic City"
15
  ---
16
 
17
- # Vector Graphics Model
18
 
19
- This model generates vector graphics (SVG) from text prompts.
 
 
 
 
20
 
21
  ## Usage
22
 
@@ -26,25 +23,40 @@ import requests
26
  API_URL = "https://api-inference.huggingface.co/models/jree423/diffsketcher"
27
  headers = {"Authorization": "Bearer YOUR_API_TOKEN"}
28
 
29
- def query(payload):
30
- response = requests.post(API_URL, headers=headers, json=payload)
31
- return response.json()
32
-
33
- # Text-to-image input
34
- output = query({
35
- "inputs": "a beautiful mountain landscape",
36
- })
37
 
38
- # The response contains:
39
- # - svg: The SVG content as a string
40
- # - svg_base64: The SVG content encoded as base64
41
- # - png_base64: A PNG version of the SVG encoded as base64
42
  ```
43
 
44
- ## Model Details
45
 
46
- This model generates vector graphics (SVG) from text prompts. It produces clean, scalable vector graphics that can be used in various applications.
 
 
 
47
 
48
  ## Limitations
49
 
50
- This is a placeholder implementation that returns simple SVG graphics. The full model implementation will be added in the future.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
 
 
 
 
 
2
  pipeline_tag: text-to-image
3
+ tags:
4
+ - text-to-image
5
+ - svg
6
+ - vector-graphics
7
+ license: mit
 
 
8
  ---
9
 
10
+ # Diffsketcher - Vector Graphics Generation
11
 
12
+ 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.
13
+
14
+ ## Model Description
15
+
16
+ DiffSketcher generates vector graphics (SVG) from text prompts. It uses a diffusion model to guide the SVG generation.
17
 
18
  ## Usage
19
 
 
23
  API_URL = "https://api-inference.huggingface.co/models/jree423/diffsketcher"
24
  headers = {"Authorization": "Bearer YOUR_API_TOKEN"}
25
 
26
+ def query(prompt):
27
+ response = requests.post(API_URL, headers=headers, json={"inputs": prompt})
28
+ return response.content # Returns the image directly
 
 
 
 
 
29
 
30
+ # Generate an image
31
+ with open("output.png", "wb") as f:
32
+ f.write(query("a red sports car"))
 
33
  ```
34
 
35
+ ## Examples
36
 
37
+ - "a red sports car"
38
+ - "a blue sedan"
39
+ - "a black SUV"
40
+ - "a yellow convertible"
41
 
42
  ## Limitations
43
 
44
+ This is a simplified implementation that:
45
+ - Primarily generates car-like SVG images
46
+ - Uses CLIP for text encoding when available
47
+ - Doesn't require downloading large model weights
48
+
49
+ ## Citation
50
+
51
+ ```
52
+ @article{xing2023diffsketcher,
53
+ title={{DiffSketcher}: Text Guided Vector Sketch Synthesis through Latent Diffusion Models},
54
+ 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},
55
+ journal={arXiv preprint arXiv:2306.14685},
56
+ year={2023}
57
+ }
58
+ ```
59
+
60
+ ## License
61
+
62
+ This model is licensed under the MIT License.