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
+9 -1
View File
@@ -2,6 +2,7 @@ import http.client
import json
import base64
import time
import os
import numpy as np
import torch
from PIL import Image
@@ -14,7 +15,14 @@ class VectorEngineImageGenerator:
"""
def __init__(self):
self.api_key = "sk-RZBLe4v8MolmD3fwOd6vdRTCaj7PohDhf4f44UNgWHEAA4zF"
# Read API key from environment variable
self.api_key = os.getenv("VECTOR_ENGINE_API_KEY")
if not self.api_key:
raise ValueError(
"VECTOR_ENGINE_API_KEY environment variable is not set. "
"Please set it before using this node: "
"export VECTOR_ENGINE_API_KEY='your-api-key-here'"
)
@classmethod
def INPUT_TYPES(cls):