-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv.example
More file actions
34 lines (26 loc) · 1.19 KB
/
Copy pathenv.example
File metadata and controls
34 lines (26 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Z-Image 后端环境变量配置
# 复制此文件为 .env 并根据需要修改配置
# 命令: cp env.example .env
# ==================== 模型配置 ====================
# 模型文件路径(相对于项目根目录或绝对路径)
MODEL_PATH=./Z-Image-Turbo
# ==================== 输出配置 ====================
# 生成图像的输出目录
OUTPUT_DIR=./outputs
# ==================== API 配置 ====================
# API 服务监听地址
API_HOST=0.0.0.0
# API 服务端口
API_PORT=8000
# ==================== CORS 配置 ====================
# 允许的前端源(多个源用逗号分隔)
# 例如: CORS_ORIGINS=http://localhost:5173,http://localhost:3000
CORS_ORIGINS=http://localhost:5173,http://localhost:3000,http://127.0.0.1:5173,http://127.0.0.1:3000
# ==================== GPU 配置 ====================
# 指定使用的 GPU 设备(可选,例如: 0 或 0,1)
# 留空则使用所有可用 GPU
# CUDA_VISIBLE_DEVICES=0
# PyTorch CUDA 内存分配配置
# 设置为 expandable_segments:True 可以避免内存碎片化,有助于解决 CUDA OOM 问题
# 如果遇到 "CUDA out of memory" 错误,建议启用此配置
PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True