# - svdq-int4-flux.1-dev
>
This upload serves as a demonstration of advanced image generation techniques using the publicly available svdq-int4-flux.1-dev model (original source: https://huggingface.co/mit-han-lab/svdq-int4-flux.1-dev/tree/main) in conjunction with my Finesse2FP16Lora and NSFW2FP16Lora. It generates 5X FASTER images than Flux1.Dev while using less than 8GB VRAM on budget GPUs.
Please note I am not the original creator of svdq-int4-flux.1-dev.
The key innovation here is the application of SWDQuant (https://github.com/mit-han-lab/nunchaku), which optimizes inference for this model far beyond simple quantization, ensuring the preservation of the original flux1-dev quality. Nunchaku isn't just another Flux model accelerator—it's a paradigm shift.
The presence of a separate BF16 preserved layers file is evidence of this careful optimization.
The showcased images were generated using this optimized svdq-int4-flux.1-dev with my Finesse2FP16 Lora in SwarmUI, 20 steps, CFG 1
To replicate these results, please create a diffusion_models/svdq-int4-flux.1-dev subdirectory and place the two .json and two .safetensors files from the provided Hugging Face link inside it.
On my Nvidia 3060, generating an image with 20 steps takes only about 50 seconds (flux1.dev-fp8 takes about 300 seg, 6x more). This represents a significant leap in efficiency (speed and size) without any noticeable degradation in quality or the characteristic flux1-dev aesthetic.
If you want to install SwarmUI: In X:\ (not in C:\Program files) put https://github.com/mcmonkeyprojects/SwarmUI/releases/download/0.9.5-Beta/install-windows.bat into it, then execute it, will create a X:\SwarmUI. Wait some minutes.
A guide for ComfyUI users https://www.reddit.com/r/StableDiffusion/comments/1j7dzhe/nunchaku_v014_svdquant_comfyui_portable/
Workflows for nunchaku
https://github.com/mit-han-lab/ComfyUI-nunchaku?tab=readme-ov-file
## Overview
- **Model ID**: `svdqint4flux1dev`
- **Category**: flux
- **Provider**: modelslab
- **Source Type**: Open Source Model
- **Status**: model_unloaded
- **Screenshot**: `https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/d0f53e67-72b7-4c6b-8262-66e8350817b6/width=896/74236333.jpeg`
## API Information
This model can be used via our HTTP API. See the API documentation and usage examples below.
### Endpoint
- **URL**: `https://modelslab.com/api/v6/images/text2img`
- **Method**: POST
### Parameters
- **`prompt`** (required): prompt help in image generation
- Type: textarea
- Example: Enter prompt
- **`model_id`** (required): Enter model_id that can help in image generation
- Type: text
- Example: Enter model_id here
- **`lora_model`** (required):
- Type: multiple_models
- **`width`** (required): width of the image
- Type: number (range: 512-1024)
- **`height`** (required): height of the image
- Type: number (range: 512-1024)
- **`negative_prompt`** (optional): Negative prompt help in avoid things that you do not want in image
- Type: textarea
- Example: Enter negative prompt that you do not want see in image
- **`scheduler`** (optional):
- Type: select (options: DPM++ 2M, DPM++ SDE, Euler, Euler a)
- **`guidance_scale`** (optional):
- Type: number (range: 1-10)
## Usage Examples
### cURL
```bash
curl --request POST \
--url https://modelslab.com/api/v6/images/text2img \
--header "Content-Type: application/json" \
--data '{
"key": "YOUR_API_KEY",
"model_id": "svdqint4flux1dev",
"prompt": "R3alisticF, hauntingly beautiful oriental necromancer, long flowing brown hair, bangs, darkly tanned skin, earrings, bone necklaces, dark eyeshadow, red lips, vibrant, front-laced transparent, filmy silk blouse, cleavage, holding skull, in a sandstone room lit by candles, High Detail, Perfect Composition, high contrast, silhouetted, chiascuro",
"width": "1024",
"height": "1024",
"negative_prompt": "(worst quality:2), (low quality:2), (normal quality:2), (jpeg artifacts), (blurry), (duplicate), (morbid), (mutilated), (out of frame), (extra limbs), (bad anatomy), (disfigured), (deformed), (cross-eye), (glitch), (oversaturated), (overexposed), (underexposed), (bad proportions), (bad hands), (bad feet), (cloned face), (long neck), (missing arms), (missing legs), (extra fingers), (fused fingers), (poorly drawn hands), (poorly drawn face), (mutation), (deformed eyes), watermark, text, logo, signature, grainy, tiling, censored, nsfw, ugly, blurry eyes, noisy image, bad lighting, unnatural skin, asymmetry",
"scheduler": "DPMSolverMultistepScheduler",
"guidance_scale": "7.5"
}'
```
### Python
```python
import requests
response = requests.post(
"https://modelslab.com/api/v6/images/text2img",
headers={
"Content-Type": "application/json"
},
json={
"key": "YOUR_API_KEY",
"model_id": "svdqint4flux1dev",
"prompt": "R3alisticF, hauntingly beautiful oriental necromancer, long flowing brown hair, bangs, darkly tanned skin, earrings, bone necklaces, dark eyeshadow, red lips, vibrant, front-laced transparent, filmy silk blouse, cleavage, holding skull, in a sandstone room lit by candles, High Detail, Perfect Composition, high contrast, silhouetted, chiascuro",
"width": "1024",
"height": "1024",
"negative_prompt": "(worst quality:2), (low quality:2), (normal quality:2), (jpeg artifacts), (blurry), (duplicate), (morbid), (mutilated), (out of frame), (extra limbs), (bad anatomy), (disfigured), (deformed), (cross-eye), (glitch), (oversaturated), (overexposed), (underexposed), (bad proportions), (bad hands), (bad feet), (cloned face), (long neck), (missing arms), (missing legs), (extra fingers), (fused fingers), (poorly drawn hands), (poorly drawn face), (mutation), (deformed eyes), watermark, text, logo, signature, grainy, tiling, censored, nsfw, ugly, blurry eyes, noisy image, bad lighting, unnatural skin, asymmetry",
"scheduler": "DPMSolverMultistepScheduler",
"guidance_scale": "7.5"
}
)
print(response.json())
```
### JavaScript
```javascript
fetch("https://modelslab.com/api/v6/images/text2img", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"key": "YOUR_API_KEY",
"model_id": "svdqint4flux1dev",
"prompt": "R3alisticF, hauntingly beautiful oriental necromancer, long flowing brown hair, bangs, darkly tanned skin, earrings, bone necklaces, dark eyeshadow, red lips, vibrant, front-laced transparent, filmy silk blouse, cleavage, holding skull, in a sandstone room lit by candles, High Detail, Perfect Composition, high contrast, silhouetted, chiascuro",
"width": "1024",
"height": "1024",
"negative_prompt": "(worst quality:2), (low quality:2), (normal quality:2), (jpeg artifacts), (blurry), (duplicate), (morbid), (mutilated), (out of frame), (extra limbs), (bad anatomy), (disfigured), (deformed), (cross-eye), (glitch), (oversaturated), (overexposed), (underexposed), (bad proportions), (bad hands), (bad feet), (cloned face), (long neck), (missing arms), (missing legs), (extra fingers), (fused fingers), (poorly drawn hands), (poorly drawn face), (mutation), (deformed eyes), watermark, text, logo, signature, grainy, tiling, censored, nsfw, ugly, blurry eyes, noisy image, bad lighting, unnatural skin, asymmetry",
"scheduler": "DPMSolverMultistepScheduler",
"guidance_scale": "7.5"
})
})
.then(response => response.json())
.then(data => console.log(data));
```
## Integration Options
### CLI
Install: `curl -fsSL https://modelslab.sh/install.sh | sh` or `brew install modelslab/tap/modelslab`
```bash
modelslab auth login # Authenticate
modelslab models search "svdqint4flux1dev" # Find this model
modelslab models detail --id svdqint4flux1dev # Get model details
modelslab generate image --prompt "..." --model svdqint4flux1dev # Generate with model
modelslab config set generation.default_model svdqint4flux1dev # Set as default
```
- Website: https://modelslab.sh
- GitHub: https://github.com/ModelsLab/modelslab-cli
### MCP Servers (Model Context Protocol)
For Claude Code, Cursor, VS Code, Windsurf, and any MCP-compatible agent.
- Generation: `https://modelslab.com/mcp/v7` (API key auth, 23 tools)
- Agent Control Plane: `https://modelslab.com/mcp/agents` (Bearer token auth, 10 tools)
Claude Code config (`~/.claude/settings.json`):
```json
{
"mcpServers": {
"modelslab-v7": {
"url": "https://modelslab.com/mcp/v7",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
```
- Documentation: https://docs.modelslab.com/mcp-web-api/overview
### Agent Skills
Install skill files directly into AI coding agents:
```bash
npx skills add modelslab/skills --all # All skills
npx skills add modelslab/skills --skill image-generation # Specific skill
npx skills add modelslab/skills --all -a claude-code -a cursor # Target agents
```
- GitHub: https://github.com/ModelsLab/skills
- Documentation: https://docs.modelslab.com/agent-skills
### SDKs
- Python: `pip install modelslab`
- TypeScript: `npm install modelslab`
- PHP: `composer require modelslab/modelslab`
- Go: `go get github.com/modelslab/modelslab-go`
- Dart: `dart pub add modelslab`
## Links
- [Model Playground](https://modelslab.com/models/community-model/svdqint4flux1dev)
- [API Documentation](https://docs.modelslab.com)
- [ModelsLab Platform](https://modelslab.com)