{"id":34497367,"url":"https://github.com/iconben/z-image-studio","last_synced_at":"2026-01-15T03:25:29.219Z","repository":{"id":327562713,"uuid":"1109708730","full_name":"iconben/z-image-studio","owner":"iconben","description":"A Cli, a webUI, and a MCP server for the Z-Image-Turbo text-to-image generation model (Tongyi-MAI/Z-Image-Turbo base model as well as quantized models)","archived":false,"fork":false,"pushed_at":"2026-01-11T13:20:04.000Z","size":7233,"stargazers_count":66,"open_issues_count":3,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-11T13:22:43.991Z","etag":null,"topics":["ai","apple","apple-silicon","cuda","diffusers","localllm","lora","mcp-server","mps","python","text-to-image","text2image","webui","z-image","z-image-turbo"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iconben.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":"iconben","patreon":"Iconben","open_collective":"iconben","buy_me_a_coffee":"iconben"}},"created_at":"2025-12-04T07:11:03.000Z","updated_at":"2026-01-11T09:36:49.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/iconben/z-image-studio","commit_stats":null,"previous_names":["iconben/z-image-studio"],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/iconben/z-image-studio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iconben%2Fz-image-studio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iconben%2Fz-image-studio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iconben%2Fz-image-studio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iconben%2Fz-image-studio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iconben","download_url":"https://codeload.github.com/iconben/z-image-studio/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iconben%2Fz-image-studio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28442270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:55:22.719Z","status":"online","status_checked_at":"2026-01-15T02:00:08.019Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","apple","apple-silicon","cuda","diffusers","localllm","lora","mcp-server","mps","python","text-to-image","text2image","webui","z-image","z-image-turbo"],"created_at":"2025-12-24T01:00:50.323Z","updated_at":"2026-01-15T03:25:29.214Z","avatar_url":"https://github.com/iconben.png","language":"Python","funding_links":["https://github.com/sponsors/iconben","https://patreon.com/Iconben","https://opencollective.com/iconben","https://buymeacoffee.com/iconben"],"categories":["Python"],"sub_categories":[],"readme":"# Z-Image Studio\n\n![Python Version](https://img.shields.io/badge/python-3.11+-blue.svg)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)\n![FastAPI](https://img.shields.io/badge/FastAPI-005571?style=flat\u0026logo=fastapi)\n![PyTorch](https://img.shields.io/badge/PyTorch-%23EE4C2C.svg?style=flat\u0026logo=PyTorch\u0026logoColor=white)\n![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97-Diffusers-yellow)\n![Apple Silicon](https://img.shields.io/badge/Apple%20Silicon-MPS-gray?logo=apple)\n![Nvidia CUDA](https://img.shields.io/badge/Nvidia-CUDA-gray?logo=nvidia)\n![AMD ROCm](https://img.shields.io/badge/AMD-ROCm-gray?logo=amd)\n[![Docs](https://img.shields.io/badge/docs-deepwiki.com-blue)](https://deepwiki.com/iconben/z-image-studio)\n\nA Cli, a webUI, and a MCP server for the **Z-Image-Turbo** text-to-image generation model (`Tongyi-MAI/Z-Image-Turbo` and its variants).\n\nThis tool is designed to run efficiently on local machines for Windows/Mac/Linux users. It features specific optimizations for **NVIDIA (CUDA)**, **Apple Silicon (MPS)**, and **AMD on Linux (ROCm)**, falling back to CPU if no compatible GPU is detected.\n\n![Screenshot 0](docs/images/screenshot0.png)\n\n## Features\n**Hybrid Interfaces**: \n  *   **CLI**: Fast, direct image generation from the terminal.\n  *   **Web UI**: Modern web interface for interactive generation.\n  *   **MCP Server**: Capability to be called by AI agents.\n\n### CLI and core features\n*   **Z-Image-Turbo Model**: Utilizes the high-quality `Tongyi-MAI/Z-Image-Turbo` model and quatized variants via `diffusers`.\n*   **MPS Acceleration**: Optimized for Mac users with Apple Silicon.\n*   **ROCm Support**: Explicitly supported on Linux for AMD GPUs.\n*   **Attention Slicing Auto-detection**: Automatically manages memory usage (e.g., enables attention slicing for systems with lower RAM/VRAM) to prevent Out-of-Memory errors and optimize performance.\n*   **Seed Control**: Reproducible image generation via CLI or Web UI.\n*   **Multiple LoRA Support**: Upload/manage LoRAs in the web UI, apply up to 4 with per-LoRA strengths in a single generation; CLI supports multiple `--lora` entries with optional strengths.\n*   **Automatic Dimension Adjustment**: Ensures image dimensions are compatible (multiples of 16).\n*   **Customizable Output Directory**: Image output directory can be customized via config file and environment variable.\n\n### Web UI features\n*   **Multilanguage Support**: English, Japanese, Chinese Simplified (zh-CN), and Chinese Traditional (zh-TW) are supported.\n*   **History Browser**: Efficiently search and browse your past generations with a paginated history that loads more items as you scroll.\n*   **Hardware-aware Model Recommendation**: The Web UI dynamically presents model precision options based on your system's detected RAM/VRAM, recommending the optimal choice for your hardware. You can also inspect available models and recommendations via the CLI.\n*   **Image Sharing**: The generated image can be downloaded to browser download directory, conveniently shared via OS share protocol, and copied into clipboard. \n*   **Theme Switch**: Light, dark and auto themes.\n*   **Mobile compatible**: Responsive layout for mobile devices.\n\n### MCP features\n*   **MCP Server (stdio + SSE + Streamable HTTP)**: Expose tools for image generation, listing models, and viewing history over Model Context Protocol; stdio entrypoints (`zimg mcp`, `zimg-mcp`) for local agents, SSE available at `/mcp-sse`, and MCP 2025-03-26 Streamable HTTP transport at `/mcp`.\n*   **Transport-Agnostic Content**: All transports (stdio, SSE, Streamable HTTP) return identical structured content for consistent agent integration.\n*   **Client Transport Selection**: Clients should try Streamable HTTP (`/mcp`) first for optimal performance, falling back to SSE (`/mcp-sse`) if needed.\n\n## Requirements\n\n*   Python \u003e= 3.11\n*   `uv` (recommended for dependency management)\n\n**Python 3.12+ Note**: `torch.compile` is disabled by default for Python 3.12+ due to known compatibility issues with the Z-Image model architecture. If you want to experiment with `torch.compile` on Python 3.12+, set `ZIMAGE_ENABLE_TORCH_COMPILE=1` via environment variable or in `~/.z-image-studio/config.json` (experimental, may cause errors).\n\n## GPU acceleration notes\n\n*   **NVIDIA (CUDA)**: Works with standard PyTorch CUDA builds.\n*   **Apple Silicon (MPS)**: Uses PyTorch MPS backend on macOS.\n*   **AMD on Linux (ROCm)**: Explicitly supported on Linux.\n    \u003e **Note**: AMD GPU support currently requires ROCm, which is only available for Linux PyTorch builds. Windows users with AMD GPUs will currently fall back to CPU.\n    *   **Installation**: Install AMD ROCm drivers/runtime for your distribution. Then install PyTorch with ROCm support (e.g., via `pip install torch --index-url https://download.pytorch.org/whl/rocm6.1` or similar). Ensure the PyTorch ROCm version matches your installed driver version.\n    *   **Verification**: The app will automatically detect your device as \"rocm\". You can confirm this by running `zimg models`.\n    *   **Troubleshooting**:\n        *   If the app falls back to CPU, ensure `torch.version.hip` is detected.\n        *   **HSA Override**: For some consumer GPUs (e.g., RX 6000/7000 series) not officially supported by all ROCm versions, you may need to set `HSA_OVERRIDE_GFX_VERSION` (e.g., `10.3.0` for RDNA2, `11.0.0` for RDNA3).\n        *   **Performance**: `torch.compile` is disabled by default on ROCm due to experimental support. You can force-enable it with `ZIMAGE_ENABLE_TORCH_COMPILE=1` if your setup (Triton/ROCm version) supports it.\n\n## Global installation\n\nIf you just want the `zimg` CLI to be available from anywhere, install it as a uv tool:\n\n```bash\nuv tool install git+https://github.com/iconben/z-image-studio.git\n# or, if you have the repo cloned locally:\n# git clone https://github.com/iconben/z-image-studio.git\n# cd z-image-studio\n# uv tool install .\n```\n\nAfter this, the `zimg` command is available globally:\n\n```bash\nzimg --help\n```\n\nTo update z-image-studio:\n```bash\nuv tool upgrade z-image-studio\n# or, if you have the repo cloned locally, you pull the latest source code:\n# git pull\n```\n\n## Windows Installation\n\nFor Windows users, a pre-built installer is available that bundles everything you need:\n\n1. Download the latest installer from [GitHub Releases](https://github.com/iconben/z-image-studio/releases)\n2. Run `Z-Image-Studio-Setup-x.x.x.exe`\n3. Follow the installation wizard\n4. Launch from the Start Menu:\n   - **Z-Image Studio (Web UI)**: Starts the web server and opens your browser\n   - **Z-Image Studio CLI**: Opens a console for command-line usage\n\n### Installation Details\n\n*   **Install Location**: `C:\\Program Files\\Z-Image Studio`\n*   **User Data**: `%LOCALAPPDATA%\\z-image-studio` (contains database, LoRAs, and outputs)\n*   **Uninstall**: Use \"Add or Remove Programs\" or the uninstall shortcut in the Start Menu\n\n### System Requirements\n\n*   Windows 10 or Windows 11\n*   NVIDIA GPU with CUDA support (recommended) or compatible AMD GPU\n*   8GB+ RAM (16GB+ recommended for full precision models)\n\n## pip / uv Installation\n\nInstall Z-Image Studio via pip or uv:\n\n```bash\npip install z-image-studio\n# or\nuv pip install z-image-studio\n```\n\nAfter installation, the `zimg` command is available globally:\n\n```bash\nzimg --help\n```\n\n### From Source\n\n```bash\ngit clone https://github.com/iconben/z-image-studio.git\ncd z-image-studio\npip install -e .\n# or\nuv pip install -e .\n```\n\n## Usage\n\nAfter installation, you can use the `zimg` command directly from your terminal.\n\n### 1. CLI Generation (Default Mode)\nGenerate images directly from the command line using the `generate` (or `gen`) subcommand.\n\n```bash\n# Basic generation\nzimg generate \"A futuristic city with neon lights\"\n\n# Using the alias 'gen'\nzimg gen \"A cute cat\"\n\n# Custom output path\nzimg gen \"A cute cat\" --output \"my_cat.png\"\n\n# High quality settings\nzimg gen \"Landscape view\" --width 1920 --height 1080 --steps 20\n\n# With a specific seed for reproducibility\nzimg gen \"A majestic dragon\" --seed 12345\n\n# Select model precision (full, q8, q4)\nzimg gen \"A futuristic city\" --precision q8\n\n# Skip writing to history DB\nzimg gen \"Quick scratch\" --no-history\n```\n\n### 2. Web Server Mode\nLaunch the web interface to generate images interactively.\n\n```bash\n# Start server on default port (http://localhost:8000)\nzimg serve\n\n# Start on custom host/port\nzimg serve --host 0.0.0.0 --port 9090\n```\n\nOnce started, open your browser to the displayed URL.\n\n### 3. MCP Server Mode (Model Context Protocol)\nRun Z-Image Studio as an MCP server:\n\n```bash\n# stdio transport (ideal for local agents/tools); also available as `zimg mcp`\nzimg-mcp\n\n# MCP transports are available when you run the web server:\nzimg serve          # Both Streamable HTTP (/mcp) and SSE (/mcp-sse) available\nzimg serve --disable-mcp   # Disable all MCP endpoints\n```\n\nAvailable tools: `generate` (prompt to image), `list_models`, and `list_history`. Logs are routed to stderr to keep MCP stdio clean.\n\n#### Connecting an AI agent (e.g., Claude Desktop) to `zimg-mcp`\n1. Ensure dependencies are installed (`uv sync`) and that `zimg-mcp` is on PATH (installed via `uv tool install .` or run locally via `uv run zimg-mcp`).\n2. In Claude Desktop (or any MCP-aware client), add a local mcp server entry like:\n   ```json\n   {\n     \"mcpServers\": {\n       \"z-image-studio\": {\n         \"command\": \"zimg-mcp\",\n         \"args\": [],\n         \"env\": {}\n       }\n     }\n   }\n   ```\n   Adjust the `command` to a full path if not on PATH. If the agent cannot find the zimg-mcp command, you can also try setting the path in environment.\n\n   Different agents may have slightly different parameters, for example, cline will timeout fast if you do not explicitly set a timeout parameter. Here is the example for cline:\n   ```json\n   {\n     \"mcpServers\": {\n       \"z-image-studio\": {\n         \"command\": \"zimg-mcp\",\n         \"type\": \"stdio\",\n         \"args\": [],,\n         \"env\": {},\n         \"disabled\": false,\n         \"autoApprove\": [],\n         \"timeout\": 300\n       }\n     }\n   }\n   ```\n   Detailed syntax may vary, please refer to the specific agent's documentation.\n3. For Clients that support remote mcp server, configure the client with the streamable Http mcp endpoint URL (meanwhile keep the server up by running `zimg serve`). Here is an example for Gemini CLI:\n   ```json\n   {\n     \"mcpServers\": {\n       \"z-image-studio\": {\n         \"httpUrl\": \"http://localhost:8000/mcp\"\n       }\n     }\n   }\n   ```\n   Detailed syntax may vary, please refer to the specific agent's documentation.\n4. For legacy SSE , run `zimg serve` and configure the client with the SSE endpoint URL. Here is an example for Cline CLI:\n   ```json\n   {\n     \"mcpServers\": {\n       \"z-image-studio\": {\n         \"url\": \"http://localhost:8000/mcp-sse/sse\"\n       }\n     }\n   }\n   ```\n   Detailed syntax may vary, please refer to the specific agent's documentation.\n5. The agent will receive tools: `generate`, `list_models`, `list_history`.\n\n\n#### MCP Content Structure\n\nThe `generate` tool returns a consistent content array with three items in this order:\n\n1. **TextContent**: Enhanced metadata including generation info, file details, and preview metadata\n   ```json\n   {\n     \"message\": \"Image generated successfully\",\n     \"duration_seconds\": 1.23,\n     \"width\": 1280,\n     \"height\": 720,\n     \"precision\": \"q8\",\n     \"model_id\": \"z-image-turbo-q8\",\n     \"seed\": 12345,\n     \"filename\": \"image_12345.png\",\n     \"file_path\": \"/absolute/path/to/image_12345.png\",\n     \"access_note\": \"Access full image via ResourceLink.uri or this URL\",\n     \"preview\": true,\n     \"preview_size\": 400,\n     \"preview_mime\": \"image/png\"\n   }\n   ```\n   - **SSE/Streamable HTTP Transports**: `url` and `access_note` point to the absolute image URL\n   - **Stdio Transport**: `file_path` and `access_note` point to the local file path\n\n2. **ResourceLink**: Main image file reference with context-appropriate URI\n   - **SSE/Streamable HTTP Transports**: Absolute URL built from request context, ZIMAGE_BASE_URL, or relative path\n   - **Stdio Transport**: file:// URI for local access\n\n   URI Building Priority (SSE/Streamable HTTP):\n   1. **Request Context** (via Context parameter) - builds absolute URL from X-Forwarded-* headers\n   2. **ZIMAGE_BASE_URL** environment variable - configured base URL\n   3. **Relative URL** - fallback when no other method available\n   \n   Example with Context parameter:\n   ```python\n   @mcp.tool()\n   async def generate_with_context(..., ctx: Context) -\u003e ...:\n       request = ctx.request_context.request\n       proto = request.headers.get('x-forwarded-proto', 'http')\n       host = request.headers.get('x-forwarded-host', 'localhost')\n       return ResourceLink(uri=f\"{proto}://{host}/outputs/image.png\", ...)\n   ```\n   ```json\n   {\n     \"type\": \"resource_link\",\n     \"name\": \"image_12345.png\",\n     \"uri\": \"https://example.com/outputs/image_12345.png\",\n     \"mimeType\": \"image/png\"\n   }\n   ```\n\n3. **ImageContent**: Thumbnail preview (base64 PNG, max 400px)\n   ```json\n   {\n     \"data\": \"base64-encoded-png-data\",\n     \"mimeType\": \"image/png\"\n   }\n   ```\n\nThis structure ensures:\n- ✅ **Consistency**: Same content for both stdio and SSE transports\n- ✅ **Efficiency**: No URL/path duplication across content items\n- ✅ **Flexibility**: ResourceLink provides file access while ImageContent offers immediate preview\n- ✅ **Compatibility**: Follows MCP best practices for structured content types\n\n## Command Line Arguments\n\n### Subcommand: `generate` (alias: `gen`)\n| Argument | Short | Type | Default | Description |\n| :--- | :--- | :--- | :--- | :--- |\n| `prompt` | | `str` | Required | The text prompt for image generation. |\n| `--output` | `-o` | `str` | `None` | Custom output filename. Defaults to `outputs/\u003cprompt-slug\u003e.png` inside the data directory. |\n| `--steps` | | `int` | `9` | Number of inference steps. Higher usually means better quality. |\n| `--width` | `-w` | `int` | `1280` | Image width (automatically adjusted to be a multiple of 8). |\n| `--height` | `-H` | `int` | `720` | Image height (automatically adjusted to be a multiple of 8). |\n| `--seed` | | `int` | `None` | Random seed for reproducible generation. |\n| `--precision` | | `str` | `q8` | Model precision (`full`, `q8`, `q4`). `q8` is the default and balanced, `full` is higher quality but slower, `q4` is fastest and uses less memory. |\n| `--lora` | | `str` | `[]` | LoRA filename or path, optionally with strength (`name.safetensors:0.8`). Can be passed multiple times (max 4); strength is clamped to -1.0..2.0. |\n| `--no-history` | | `bool` | `False` | Do not record this generation in the history database. |\n\n### Subcommand: `serve`\n| Argument | Type | Default | Description |\n| :--- | :--- | :--- | :--- |\n| `--host` | `str` | `0.0.0.0` | Host to bind the server to. |\n| `--port` | `int` | `8000` | Port to bind the server to. |\n| `--reload` | `bool` | `False` | Enable auto-reload (for development). |\n| `--timeout-graceful-shutdown` | `int` | `5` | Seconds to wait for graceful shutdown before forcing exit. |\n| `--disable-mcp` | `bool` | `False` | Disable all MCP endpoints (`/mcp` and `/mcp-sse`). |\n\n### Subcommand: `models`\n| Argument | Short | Type | Default | Description |\n| :--- | :--- | :--- | :--- | :--- |\n| (None)   |       |       |         | Lists available image generation models, highlights the one recommended for your system's hardware, and displays their corresponding Hugging Face model IDs. |\n\n### Subcommand: `mcp`\n| Argument | Type | Default | Description |\n| :--- | :--- | :--- | :--- |\n| (none) | | | Stdio-only MCP server (for agents). Use `zimg-mcp` or `zimg mcp`. |\n\n\n## Data Directory and Configuration\n\nBy default, Z-Image Studio uses the following directories:\n\n*   **Data Directory** (Database, LoRAs): `~/.local/share/z-image-studio` (Linux), `~/Library/Application Support/z-image-studio` (macOS), or `%LOCALAPPDATA%\\z-image-studio` (Windows).\n*   **Output Directory** (Generated Images): `\u003cData Directory\u003e/outputs` by default. \n\n### Configure the directory\n*   **Config File**: `~/.z-image-studio/config.json` (created on first run after migration).\n    *   Override the data directory with `Z_IMAGE_STUDIO_DATA_DIR`.\n    *   If you want the output directory sit in another location instead of the data directory, you can override it with `Z_IMAGE_STUDIO_OUTPUT_DIR`.\n\nDirectory structure inside Data Directory by default:\n*   `zimage.db`: SQLite database\n*   `loras/`: LoRA models\n*   `outputs/`: Generated image files\n\n### One-time Migration (automatic)\nOn first run without an existing config file, the app migrates legacy data by moving:\n*   `outputs/`, `loras/`, and `zimage.db` from the current working directory (old layout) into the new locations.\n\n\n## Screenshots\n\n![Screenshot 1](docs/images/screenshot1.png)\n*(Screenshot 1: Two column layout with History browser collapsed)*\n\n![Screenshot 2](docs/images/screenshot2.png)\n*(Screenshot 2: Three column layout with History browser pinned)*\n\n\n![Screenshot 3](docs/images/screenshot3.png)\n*(Screenshot 3: Generated Image zoomed to fit the screen)*\n\n\n## Development\n\n### Installation in Project Virtual Environment\n\n1.  **Clone the repository:**\n    ```bash\n    git clone https://github.com/iconben/z-image-studio.git\n    cd z-image-studio\n    ```\n\n### To run the source code directly without installation:\n\n1.  **Run CLI:**\n    ```bash\n    uv run src/zimage/cli.py generate \"A prompt\"\n    ```\n\n2.  **Run Server:**\n    ```bash\n    uv run src/zimage/cli.py serve --reload\n    ```\n\n3.  **Run tests:**\n    ```bash\n    uv run pytest\n    ```\n\n### Optional: Install in editable mode:**\n    First install it:\n    ```bash\n    uv pip install -e .\n    ```\n\n    After this, the `zimg` command is available **inside this virtual environment**:\n\n    Then use the zimg command in either ways:\n\n    Using `uv` (recommended):\n    ```bash\n    uv run zimg generate \"A prompt\"\n    ```\n\n    or use in more traditional way:\n    ```bash\n    source .venv/bin/activate  # Under Windows: .venv\\Scripts\\activate\n    zimg serve\n    ```\n\n### Optional: Override the folder settings with environment variables\n    If you do not want your development data mess up your production data,\n    You can define environment variable Z_IMAGE_STUDIO_DATA_DIR to change the data folder for\n    You can also define environment variable Z_IMAGE_STUDIO_OUTPUT_DIR to change the output folder to another separate folder\n\n### Environment Variables\n| Variable | Description |\n| :--- | :--- |\n| `ZIMAGE_ENABLE_TORCH_COMPILE` | Force enable `torch.compile` optimization (experimental). By default disabled for Python 3.12+ due to known compatibility issues. Can be set to `1` via environment variable or config file (`~/.z-image-studio/config.json`) to enable at your own risk. |\n| `Z_IMAGE_STUDIO_DATA_DIR` | Override the default data directory location. |\n| `Z_IMAGE_STUDIO_OUTPUT_DIR` | Override the default output directory location. |\n## Notes\n\n*   **Guidance Scale**: The script hardcodes `guidance_scale=0.0` as required by the Turbo model distillation process.\n*   **Safety Checker**: Disabled by default to prevent false positives and potential black image outputs during local testing.\n\nFor detailed architecture and development guidelines, see [docs/architecture.md](docs/architecture.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficonben%2Fz-image-studio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficonben%2Fz-image-studio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficonben%2Fz-image-studio/lists"}