fix:api_key设置为从环境变量获取

This commit is contained in:
dzy1128
2025-12-01 16:33:05 +08:00
parent 0b56c63b60
commit c40a9e8bf0
7 changed files with 353 additions and 589 deletions
+61 -10
View File
@@ -1,23 +1,74 @@
"""
Configuration file for Vector Engine API
Configuration Example for Vector Engine API
To use:
1. Copy this file to config.py
2. Update with your actual API key
3. Import in vector_engine_node.py
This file shows how to configure the Vector Engine API key.
The actual API key should be set via environment variable for security.
DO NOT hardcode API keys in your code!
"""
# Vector Engine API Configuration
VECTOR_ENGINE_API_KEY = "sk-your-api-key-here"
# ==========================================
# API Key Configuration (RECOMMENDED METHOD)
# ==========================================
# API Endpoint
# Set the environment variable before starting ComfyUI:
#
# Linux/macOS:
# export VECTOR_ENGINE_API_KEY="sk-your-api-key-here"
# python main.py
#
# Windows (CMD):
# set VECTOR_ENGINE_API_KEY=sk-your-api-key-here
# python main.py
#
# Windows (PowerShell):
# $env:VECTOR_ENGINE_API_KEY="sk-your-api-key-here"
# python main.py
# ==========================================
# Permanent Configuration
# ==========================================
# Linux/macOS - Add to ~/.bashrc or ~/.zshrc:
# export VECTOR_ENGINE_API_KEY="sk-your-api-key-here"
#
# Windows - Use setx for permanent environment variable:
# setx VECTOR_ENGINE_API_KEY "sk-your-api-key-here"
# ==========================================
# Docker Configuration
# ==========================================
# In docker-compose.yml:
# environment:
# - VECTOR_ENGINE_API_KEY=sk-your-api-key-here
#
# Or with docker run:
# docker run -e VECTOR_ENGINE_API_KEY="sk-your-api-key-here" ...
# ==========================================
# API Configuration
# ==========================================
# API Endpoint (configured in the node, no need to change)
VECTOR_ENGINE_API_HOST = "api.vectorengine.ai"
# Default Model
# Default Model (configured in the node)
DEFAULT_MODEL = "gemini-3-pro-image-preview"
# Default Generation Config
# Default Generation Settings
DEFAULT_SYSTEM_PROMPT = "You are an AI assistant skilled in generating images and editing pictures."
DEFAULT_ASPECT_RATIO = "1:1"
DEFAULT_IMAGE_SIZE = "1K"
# ==========================================
# Security Notes
# ==========================================
# ✓ DO: Use environment variables for API keys
# ✓ DO: Add sensitive files to .gitignore
# ✓ DO: Use secrets management in production
# ✗ DON'T: Hardcode API keys in code
# ✗ DON'T: Commit API keys to version control
# ✗ DON'T: Share API keys in public repositories