Upload README.md with huggingface_hub
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283---license: mittags:- vector-graphics- svg- diffusion- art-generation- sketchlibrary_name: transformerspipeline_tag: image-to-image---# DiffSketchEdit - Vector Graphics EditingDiffSketchEdit 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.## Model DescriptionThis 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.## Features- ✅ **Working SVG Generation**: Produces actual vector graphics content, not blank images- ✅ **Multiple Styles**: Supports different artistic styles and approaches- ✅ **API Ready**: Deployed with Flask API for easy integration- ✅ **Real-time Generation**: Fast inference suitable for interactive applications## Usage```pythonimport requests# Edit/colorize a vector graphicresponse = requests.post("http://localhost:5000/diffsketchedit/edit_base64",json={"prompt": "make it colorful","edit_type": "colorize","strength": 0.7,"width": 512,"height": 512})svg_data = response.json()["svg_base64"]```## API EndpointsThe model is deployed with the following endpoints:- `POST /generate_base64` - Generate SVG and return as base64- `POST /generate` - Generate SVG and return as file download- `GET /health` - Health check endpoint## Example OutputThe model generates proper SVG content with actual vector graphics elements, including:- Geometric shapes and paths- Color fills and strokes- Text elements and styling- Proper SVG structure and metadata## Technical Details- **Framework**: PyTorch + Flask API- **Output Format**: SVG (Scalable Vector Graphics)- **Input**: Text prompts- **Dependencies**: torch, diffusers, transformers, svgwrite, flask## DeploymentThis model is part of a unified API server that handles all three vector graphics models:- DiffSketcher (painterly vector graphics)- SVGDreamer (styled vector graphics)- DiffSketchEdit (vector editing)## Status✅ **RESOLVED**: The blank image issue has been completely fixed. All models now generate proper SVG content.## License123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104---license: mittags:- image-to-image- vector-graphics- svg- image-editing- style-transferlibrary_name: transformerspipeline_tag: image-to-imagetask: image-to-image---# Diffsketchedit - Vector Graphics ModelEdits and enhances vector graphics based on text instructions## Model Type- **Pipeline**: `image-to-image`- **Task**: `image-to-image`- **Input**: text- **Output**: svg## Features- ✅ **Working SVG Generation**: Produces actual vector graphics content, not blank images- ✅ **Multiple Styles**: colorize, stylize, modify- ✅ **API Ready**: Deployed with proper Inference API handler- ✅ **Real-time Generation**: Fast inference suitable for interactive applications## Input Parameters- `prompt` (required): Text description of what to generate/edit- `edit_type` (optional): Type of editing operation- `colorize`: Add vibrant colors to designs- `stylize`: Apply artistic styles and effects- `modify`: Transform and enhance existing graphics- `strength` (optional): Editing strength (0.0 to 1.0, default: 0.7)- `num_paths` (optional): Number of vector paths (default: 16)- `width` (optional): Output width in pixels (default: 512)- `height` (optional): Output height in pixels (default: 512)## Usage```pythonimport requestsimport base64headers = {"Authorization": "Bearer YOUR_HF_TOKEN"}# Colorize an existing designresponse = requests.post("https://api-inference.huggingface.co/models/jree423/diffsketchedit",headers=headers,json={"inputs": "make it colorful and vibrant","parameters": {"edit_type": "colorize","strength": 0.8,"width": 512,"height": 512}})result = response.json()svg_content = base64.b64decode(result["svg_base64"]).decode('utf-8')# Save the edited SVGwith open("colorized_design.svg", "w") as f:f.write(svg_content)```## API ResponseThe model returns a JSON object with:- `svg_content`: Raw SVG markup- `svg_base64`: Base64-encoded SVG for easy embedding- `model`: Model name- `prompt`: Input prompt- Additional parameters based on model type## Example OutputThe model generates proper SVG content with actual vector graphics elements:- Geometric shapes and paths- Color fills and strokes- Text elements and styling- Proper SVG structure and metadata## Technical Details- **Framework**: PyTorch + Custom Handler- **Output Format**: SVG (Scalable Vector Graphics)- **Dependencies**: Minimal Python dependencies for fast startup- **Deployment**: Optimized for Hugging Face Inference API## Status✅ **RESOLVED**: The blank image issue has been completely fixed. Model now generates proper SVG content.## License
README.md+57-36