Remove Transformers.js tag
#3
by
Xenova
HF Staff
- opened
README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
---
|
| 2 |
license: creativeml-openrail-m
|
| 3 |
base_model: runwayml/stable-diffusion-v1-5
|
| 4 |
-
library_name:
|
| 5 |
tags:
|
| 6 |
- stable-diffusion
|
| 7 |
- text-to-image
|
|
@@ -9,7 +9,6 @@ tags:
|
|
| 9 |
- webgpu
|
| 10 |
- browser-ai
|
| 11 |
- onnx
|
| 12 |
-
- transformers.js
|
| 13 |
- zhare-ai
|
| 14 |
- client-side
|
| 15 |
- privacy-preserving
|
|
@@ -58,7 +57,6 @@ model-index:
|
|
| 58 |
|
| 59 |

|
| 60 |

|
| 61 |
-

|
| 62 |

|
| 63 |

|
| 64 |
|
|
@@ -80,7 +78,6 @@ This is a browser-optimized implementation of Stable Diffusion v1.5, specificall
|
|
| 80 |
- π **Privacy-First**: All processing happens locally, protecting user prompts and generated content
|
| 81 |
- π± **Cross-Platform**: Compatible with desktop and mobile browsers
|
| 82 |
- π οΈ **Production-Ready**: Optimized for real-world web applications
|
| 83 |
-
- π **Transformers.js Compatible**: Direct integration with Hugging Face Transformers.js
|
| 84 |
|
| 85 |
## π Quick Start
|
| 86 |
|
|
@@ -92,57 +89,6 @@ git lfs install
|
|
| 92 |
git clone https://huggingface.co/Zhare-AI/sd-1-5-webgpu
|
| 93 |
```
|
| 94 |
|
| 95 |
-
### Usage with Transformers.js
|
| 96 |
-
|
| 97 |
-
```javascript
|
| 98 |
-
import { pipeline } from '@huggingface/transformers';
|
| 99 |
-
|
| 100 |
-
// Initialize the pipeline
|
| 101 |
-
const generator = await pipeline(
|
| 102 |
-
'text-to-image',
|
| 103 |
-
'Zhare-AI/sd-1-5-webgpu',
|
| 104 |
-
{
|
| 105 |
-
device: 'webgpu',
|
| 106 |
-
dtype: 'fp16'
|
| 107 |
-
}
|
| 108 |
-
);
|
| 109 |
-
|
| 110 |
-
// Generate an image
|
| 111 |
-
const result = await generator(
|
| 112 |
-
'A majestic mountain landscape at sunrise, digital art',
|
| 113 |
-
{
|
| 114 |
-
num_inference_steps: 20,
|
| 115 |
-
guidance_scale: 7.5,
|
| 116 |
-
height: 512,
|
| 117 |
-
width: 512
|
| 118 |
-
}
|
| 119 |
-
);
|
| 120 |
-
|
| 121 |
-
// Display the result
|
| 122 |
-
document.getElementById('output').src = result.images[0];
|
| 123 |
-
```
|
| 124 |
-
|
| 125 |
-
### Advanced Configuration
|
| 126 |
-
|
| 127 |
-
```javascript
|
| 128 |
-
// Custom generation parameters
|
| 129 |
-
const advancedOptions = {
|
| 130 |
-
prompt: "A futuristic city with flying cars, neon lights, cyberpunk style",
|
| 131 |
-
negative_prompt: "blurry, low quality, distorted, ugly, deformed",
|
| 132 |
-
num_inference_steps: 25,
|
| 133 |
-
guidance_scale: 8.0,
|
| 134 |
-
height: 512,
|
| 135 |
-
width: 512,
|
| 136 |
-
seed: 12345, // For reproducible results
|
| 137 |
-
|
| 138 |
-
// Memory optimization for lower-end devices
|
| 139 |
-
enable_attention_slicing: true,
|
| 140 |
-
enable_cpu_offload: false
|
| 141 |
-
};
|
| 142 |
-
|
| 143 |
-
const image = await generator(advancedOptions.prompt, advancedOptions);
|
| 144 |
-
```
|
| 145 |
-
|
| 146 |
## π Performance Specifications
|
| 147 |
|
| 148 |
### Model Architecture
|
|
@@ -190,43 +136,6 @@ const image = await generator(advancedOptions.prompt, advancedOptions);
|
|
| 190 |
|
| 191 |
*All browsers support WebAssembly fallback for universal compatibility*
|
| 192 |
|
| 193 |
-
## βοΈ Configuration Options
|
| 194 |
-
|
| 195 |
-
### Generation Parameters
|
| 196 |
-
|
| 197 |
-
```javascript
|
| 198 |
-
const generationConfig = {
|
| 199 |
-
// Core settings
|
| 200 |
-
num_inference_steps: 20, // 10-50 (quality vs speed trade-off)
|
| 201 |
-
guidance_scale: 7.5, // 1.0-20.0 (prompt adherence)
|
| 202 |
-
height: 512, // Must be multiple of 64
|
| 203 |
-
width: 512, // Must be multiple of 64
|
| 204 |
-
|
| 205 |
-
// Quality settings
|
| 206 |
-
negative_prompt: "blurry, low quality, distorted",
|
| 207 |
-
seed: undefined, // Random seed, or integer for reproducibility
|
| 208 |
-
|
| 209 |
-
// Performance optimizations
|
| 210 |
-
enable_attention_slicing: true, // Reduces VRAM usage
|
| 211 |
-
enable_sequential_cpu_offload: false, // CPU fallback for components
|
| 212 |
-
use_fp16: true // Half precision for speed/memory
|
| 213 |
-
};
|
| 214 |
-
```
|
| 215 |
-
|
| 216 |
-
### Memory Optimization
|
| 217 |
-
|
| 218 |
-
For devices with limited VRAM or older hardware:
|
| 219 |
-
|
| 220 |
-
```javascript
|
| 221 |
-
const memoryOptimizedConfig = {
|
| 222 |
-
num_inference_steps: 15, // Fewer steps = less memory
|
| 223 |
-
guidance_scale: 7.0, // Slightly lower guidance
|
| 224 |
-
enable_attention_slicing: true, // Essential for <6GB VRAM
|
| 225 |
-
enable_sequential_cpu_offload: true, // Move components to CPU when needed
|
| 226 |
-
use_safety_checker: false // Disable to save ~600MB
|
| 227 |
-
};
|
| 228 |
-
```
|
| 229 |
-
|
| 230 |
## π Model Details
|
| 231 |
|
| 232 |
### Training Information
|
|
|
|
| 1 |
---
|
| 2 |
license: creativeml-openrail-m
|
| 3 |
base_model: runwayml/stable-diffusion-v1-5
|
| 4 |
+
library_name: onnx
|
| 5 |
tags:
|
| 6 |
- stable-diffusion
|
| 7 |
- text-to-image
|
|
|
|
| 9 |
- webgpu
|
| 10 |
- browser-ai
|
| 11 |
- onnx
|
|
|
|
| 12 |
- zhare-ai
|
| 13 |
- client-side
|
| 14 |
- privacy-preserving
|
|
|
|
| 57 |
|
| 58 |

|
| 59 |

|
|
|
|
| 60 |

|
| 61 |

|
| 62 |
|
|
|
|
| 78 |
- π **Privacy-First**: All processing happens locally, protecting user prompts and generated content
|
| 79 |
- π± **Cross-Platform**: Compatible with desktop and mobile browsers
|
| 80 |
- π οΈ **Production-Ready**: Optimized for real-world web applications
|
|
|
|
| 81 |
|
| 82 |
## π Quick Start
|
| 83 |
|
|
|
|
| 89 |
git clone https://huggingface.co/Zhare-AI/sd-1-5-webgpu
|
| 90 |
```
|
| 91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
## π Performance Specifications
|
| 93 |
|
| 94 |
### Model Architecture
|
|
|
|
| 136 |
|
| 137 |
*All browsers support WebAssembly fallback for universal compatibility*
|
| 138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
## π Model Details
|
| 140 |
|
| 141 |
### Training Information
|