✨ New Features: - Enhanced Azure OpenAI SDK integration with 2025-04-01-preview API - Modular architecture with separate configuration and image processing modules - Enterprise-grade error handling and logging - Comprehensive type safety and documentation - Batch image processing support - Smart environment variable management 🔧 Technical Improvements: - Replaced manual HTTP requests with official Azure OpenAI SDK - Added AzureConfigManager for centralized configuration management - Created ImageProcessor utility for efficient image conversions - Implemented robust retry mechanisms and error handling - Added comprehensive logging and monitoring capabilities 📁 New Files: - src/openai_image_api/azure_config.py - Configuration management - src/openai_image_api/image_utils.py - Image processing utilities - examples/azure_image_edit_example.py - Complete usage examples - test_integration.py - Integration testing suite - QUICK_START.md - Quick start guide - config.env.example - Configuration template - Multiple documentation files for better user experience 🛠️ Enhanced Files: - Updated nodes.py with improved Azure OpenAI integration - Enhanced README.md with comprehensive documentation - Updated pyproject.toml with new dependencies - Improved .gitignore with project-specific rules 🎯 Key Benefits: - Simplified API usage with higher-level abstractions - Better error handling and debugging capabilities - Enhanced security with proper credential management - Improved maintainability through modular design - Comprehensive testing and validation This update transforms the project into an enterprise-ready Azure OpenAI image editing solution while maintaining backward compatibility with existing ComfyUI workflows.
34 lines
1.1 KiB
Bash
34 lines
1.1 KiB
Bash
# Azure OpenAI 图像编辑配置示例
|
|
# 复制此文件为 .env 并填入您的实际配置
|
|
|
|
# Azure OpenAI 配置 (主要)
|
|
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com
|
|
AZURE_OPENAI_API_KEY=your-azure-openai-api-key
|
|
AZURE_OPENAI_API_VERSION=2025-04-01-preview
|
|
AZURE_OPENAI_DEPLOYMENT=gpt-image-1
|
|
|
|
# 或者使用简化格式
|
|
# AZURE_ENDPOINT=https://your-resource.openai.azure.com
|
|
# AZURE_API_KEY=your-azure-openai-api-key
|
|
|
|
# OpenAI 配置 (如果使用 OpenAI 服务)
|
|
# OPENAI_API_KEY=your-openai-api-key
|
|
|
|
# 可选配置
|
|
# AZURE_OPENAI_TIMEOUT=60
|
|
# AZURE_OPENAI_MAX_RETRIES=3
|
|
|
|
# 日志级别 (DEBUG, INFO, WARNING, ERROR)
|
|
# LOG_LEVEL=INFO
|
|
|
|
# 示例配置说明:
|
|
# 1. AZURE_OPENAI_ENDPOINT: 您的 Azure OpenAI 资源端点
|
|
# 2. AZURE_OPENAI_API_KEY: 您的 Azure OpenAI API 密钥
|
|
# 3. AZURE_OPENAI_API_VERSION: API 版本,建议使用 2025-04-01-preview
|
|
# 4. AZURE_OPENAI_DEPLOYMENT: 部署名称,通常是 gpt-image-1
|
|
|
|
# 安全提示:
|
|
# - 请勿将 .env 文件提交到版本控制系统
|
|
# - 定期轮换您的 API 密钥
|
|
# - 使用环境变量而非硬编码密钥
|