Spaces:
Running
on
Zero
Running
on
Zero
Fix README configuration for Spaces deployment
Browse files
README.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Z Image Turbo - Production Edition
|
| 2 |
|
| 3 |
A production-ready, optimized image generation and transformation application built with Gradio and Diffusers. This application addresses common production challenges including error handling, resource management, and performance optimization.
|
|
@@ -32,57 +43,6 @@ A production-ready, optimized image generation and transformation application bu
|
|
| 32 |
- PyTorch 2.0+ for optimal performance
|
| 33 |
- xformers installed for memory efficiency
|
| 34 |
|
| 35 |
-
## π οΈ Installation
|
| 36 |
-
|
| 37 |
-
### 1. Clone the Repository
|
| 38 |
-
```bash
|
| 39 |
-
git clone https://huggingface.co/spaces/lulavc/Z-Image-Turbo
|
| 40 |
-
cd Z-Image-Turbo
|
| 41 |
-
```
|
| 42 |
-
|
| 43 |
-
### 2. Install Dependencies
|
| 44 |
-
```bash
|
| 45 |
-
pip install -r requirements.txt
|
| 46 |
-
```
|
| 47 |
-
|
| 48 |
-
### 3. Run the Application
|
| 49 |
-
```bash
|
| 50 |
-
python app.py
|
| 51 |
-
```
|
| 52 |
-
|
| 53 |
-
## ποΈ Architecture
|
| 54 |
-
|
| 55 |
-
### Module Structure
|
| 56 |
-
```
|
| 57 |
-
app.py # Main application with UI
|
| 58 |
-
βββ ModelManager # Handles model loading and optimization
|
| 59 |
-
βββ ImageProcessor # Processes generation and transformation
|
| 60 |
-
βββ CacheManager # Manages caching with LRU and TTL
|
| 61 |
-
βββ SystemMonitor # Tracks system resources and performance
|
| 62 |
-
```
|
| 63 |
-
|
| 64 |
-
### Key Classes
|
| 65 |
-
|
| 66 |
-
#### ModelManager
|
| 67 |
-
- Loads and initializes models with optimal settings
|
| 68 |
-
- Applies performance optimizations with fallbacks
|
| 69 |
-
- Manages model lifecycle and resources
|
| 70 |
-
|
| 71 |
-
#### ImageProcessor
|
| 72 |
-
- Handles image generation and transformation
|
| 73 |
-
- Applies style enhancements and optimizations
|
| 74 |
-
- Manages error scenarios gracefully
|
| 75 |
-
|
| 76 |
-
#### CacheManager
|
| 77 |
-
- Implements LRU cache with TTL expiration
|
| 78 |
-
- Reduces redundant generations
|
| 79 |
-
- Manages cache size and cleanup
|
| 80 |
-
|
| 81 |
-
#### SystemMonitor
|
| 82 |
-
- Tracks system resources (CPU, GPU, memory)
|
| 83 |
-
- Monitors application performance metrics
|
| 84 |
-
- Provides health check endpoints
|
| 85 |
-
|
| 86 |
## π§ Configuration
|
| 87 |
|
| 88 |
### Environment Variables
|
|
@@ -109,18 +69,7 @@ The application automatically optimizes based on available hardware:
|
|
| 109 |
- Uptime and error tracking
|
| 110 |
|
| 111 |
### Health Checks
|
| 112 |
-
The application provides comprehensive health monitoring
|
| 113 |
-
```python
|
| 114 |
-
async def health_check():
|
| 115 |
-
return {
|
| 116 |
-
"status": "healthy",
|
| 117 |
-
"model_loaded": True,
|
| 118 |
-
"optimizations": ["xformers", "cpu_offload"],
|
| 119 |
-
"uptime": 3600,
|
| 120 |
-
"generation_count": 100,
|
| 121 |
-
"cache_hit_rate": 75.5
|
| 122 |
-
}
|
| 123 |
-
```
|
| 124 |
|
| 125 |
## π Troubleshooting
|
| 126 |
|
|
@@ -238,4 +187,4 @@ This project is licensed under the MIT License.
|
|
| 238 |
|
| 239 |
---
|
| 240 |
|
| 241 |
-
**Created with β€οΈ by AI Agent Framework Specialist**
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Z Image Turbo - Production Edition
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: pink
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: "4.20.0"
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
# Z Image Turbo - Production Edition
|
| 13 |
|
| 14 |
A production-ready, optimized image generation and transformation application built with Gradio and Diffusers. This application addresses common production challenges including error handling, resource management, and performance optimization.
|
|
|
|
| 43 |
- PyTorch 2.0+ for optimal performance
|
| 44 |
- xformers installed for memory efficiency
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
## π§ Configuration
|
| 47 |
|
| 48 |
### Environment Variables
|
|
|
|
| 69 |
- Uptime and error tracking
|
| 70 |
|
| 71 |
### Health Checks
|
| 72 |
+
The application provides comprehensive health monitoring with real-time metrics tracking.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
## π Troubleshooting
|
| 75 |
|
|
|
|
| 187 |
|
| 188 |
---
|
| 189 |
|
| 190 |
+
**Created with β€οΈ by AI Agent Framework Specialist**
|