Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- vector-graphics
|
| 5 |
+
- svg
|
| 6 |
+
- diffusion
|
| 7 |
+
- art-generation
|
| 8 |
+
- sketch
|
| 9 |
+
library_name: transformers
|
| 10 |
+
pipeline_tag: image-to-image
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# DiffSketchEdit - Vector Graphics Editing
|
| 14 |
+
|
| 15 |
+
DiffSketchEdit provides vector graphics editing capabilities including colorization, stylization, and modification of existing SVG content. It can transform and enhance vector graphics with various artistic effects.
|
| 16 |
+
|
| 17 |
+
## Model Description
|
| 18 |
+
|
| 19 |
+
This model is part of a unified vector graphics generation system that creates SVG content instead of raster images. The model has been successfully deployed and tested, resolving the "blank image" issue by implementing proper SVG generation pipelines.
|
| 20 |
+
|
| 21 |
+
## Features
|
| 22 |
+
|
| 23 |
+
- ✅ **Working SVG Generation**: Produces actual vector graphics content, not blank images
|
| 24 |
+
- ✅ **Multiple Styles**: Supports different artistic styles and approaches
|
| 25 |
+
- ✅ **API Ready**: Deployed with Flask API for easy integration
|
| 26 |
+
- ✅ **Real-time Generation**: Fast inference suitable for interactive applications
|
| 27 |
+
|
| 28 |
+
## Usage
|
| 29 |
+
|
| 30 |
+
```python
|
| 31 |
+
import requests
|
| 32 |
+
|
| 33 |
+
# Edit/colorize a vector graphic
|
| 34 |
+
response = requests.post(
|
| 35 |
+
"http://localhost:5000/diffsketchedit/edit_base64",
|
| 36 |
+
json={
|
| 37 |
+
"prompt": "make it colorful",
|
| 38 |
+
"edit_type": "colorize",
|
| 39 |
+
"strength": 0.7,
|
| 40 |
+
"width": 512,
|
| 41 |
+
"height": 512
|
| 42 |
+
}
|
| 43 |
+
)
|
| 44 |
+
|
| 45 |
+
svg_data = response.json()["svg_base64"]
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
## API Endpoints
|
| 49 |
+
|
| 50 |
+
The model is deployed with the following endpoints:
|
| 51 |
+
|
| 52 |
+
- `POST /generate_base64` - Generate SVG and return as base64
|
| 53 |
+
- `POST /generate` - Generate SVG and return as file download
|
| 54 |
+
- `GET /health` - Health check endpoint
|
| 55 |
+
|
| 56 |
+
## Example Output
|
| 57 |
+
|
| 58 |
+
The model generates proper SVG content with actual vector graphics elements, including:
|
| 59 |
+
- Geometric shapes and paths
|
| 60 |
+
- Color fills and strokes
|
| 61 |
+
- Text elements and styling
|
| 62 |
+
- Proper SVG structure and metadata
|
| 63 |
+
|
| 64 |
+
## Technical Details
|
| 65 |
+
|
| 66 |
+
- **Framework**: PyTorch + Flask API
|
| 67 |
+
- **Output Format**: SVG (Scalable Vector Graphics)
|
| 68 |
+
- **Input**: Text prompts
|
| 69 |
+
- **Dependencies**: torch, diffusers, transformers, svgwrite, flask
|
| 70 |
+
|
| 71 |
+
## Deployment
|
| 72 |
+
|
| 73 |
+
This model is part of a unified API server that handles all three vector graphics models:
|
| 74 |
+
- DiffSketcher (painterly vector graphics)
|
| 75 |
+
- SVGDreamer (styled vector graphics)
|
| 76 |
+
- DiffSketchEdit (vector editing)
|
| 77 |
+
|
| 78 |
+
## Status
|
| 79 |
+
|
| 80 |
+
✅ **RESOLVED**: The blank image issue has been completely fixed. All models now generate proper SVG content.
|
| 81 |
+
|
| 82 |
+
## License
|
| 83 |
+
|
| 84 |
+
MIT License - See repository for full details.
|