Skip to content

Conversation

@jasonacox
Copy link
Owner

This pull request introduces support for OpenAI's DALL-E image generation alongside the existing SwarmUI provider, updates the documentation accordingly, and refactors the image generation logic to dynamically select the provider based on configuration. Key changes include new environment variables for OpenAI settings, updates to documentation and examples, and enhancements to the image generation codebase.

New Features and Enhancements:

  • OpenAI Image Generation Support:

    • Added support for OpenAI DALL-E models with new environment variables (OPENAI_IMAGE_API_KEY, OPENAI_IMAGE_MODEL, etc.). [1] [2]
    • Refactored image generation logic to dynamically initialize the provider (SwarmUI or OpenAI) based on the IMAGE_PROVIDER setting.
  • Documentation Updates:

    • Updated README.md with quick start instructions, environment variables, and a new section on image generation. [1] [2] [3]
    • Added detailed configuration examples for both SwarmUI and OpenAI in IMAGE_CONFIG.md.
    • Expanded RELEASE.md to include release notes for recent versions, highlighting new features and fixes.

Codebase Refactoring:

  • Image Generator Refactor:
    • Replaced the static ImageGenerator instance with a dynamic create_image_generator function to support multiple providers.
    • Improved error handling and logging for image generator initialization.

These changes improve flexibility by enabling users to choose between local (SwarmUI) and cloud-based (OpenAI) image generation, while ensuring clear documentation and robust configuration options.

@jasonacox jasonacox requested a review from Copilot August 3, 2025 06:14

This comment was marked as outdated.

@jasonacox jasonacox requested a review from Copilot August 3, 2025 06:26

This comment was marked as outdated.

jasonacox and others added 3 commits August 2, 2025 23:29
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…Generator to use environment variable for host configuration
@jasonacox jasonacox requested a review from Copilot August 3, 2025 06:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces comprehensive support for OpenAI's DALL-E image generation alongside the existing SwarmUI provider, refactoring the image generation system to support multiple providers and updating documentation with new features and configuration options.

Key Changes:

  • Adds OpenAI DALL-E image generation support with dedicated environment variables
  • Refactors image generation system from static instance to dynamic factory pattern
  • Updates configuration management and documentation with new provider options

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
chatbot/test_image_generators.py New test script for validating both SwarmUI and OpenAI image generators
chatbot/app/image/swarmui_generator.py New dedicated SwarmUI image generator implementation with base class inheritance
chatbot/app/image/openai_generator.py New OpenAI DALL-E image generator with API validation and model-specific constraints
chatbot/app/image/base.py New abstract base class defining the image generator interface
chatbot/app/image/init.py Refactored from monolithic class to factory pattern with provider selection
chatbot/app/core/config.py Added OpenAI image generation environment variables and version bump
chatbot/app/api/routes.py Updated routes to use dynamic image generator creation and handle multiple formats
chatbot/RELEASE.md New release documentation with version history
chatbot/README.md Updated with quick start guide and image generation configuration
chatbot/IMAGE_CONFIG.md New comprehensive image generation configuration guide
Comments suppressed due to low confidence (2)

chatbot/test_image_generators.py:50

  • The test is using OPENAI_API_KEY but should use OPENAI_IMAGE_API_KEY to match the documented dedicated environment variable for image generation.
            api_key=os.environ.get("OPENAI_API_KEY", "fake-key-for-testing"),  # Use env var or clearly fake key

chatbot/test_image_generators.py:78

  • Inconsistent environment variable usage. Should use OPENAI_IMAGE_API_KEY instead of OPENAI_API_KEY to match the dedicated image generation configuration.
            api_key=os.environ.get("OPENAI_API_KEY", "sk-test-fake-key"),  # Use env var or obviously fake key

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jasonacox jasonacox merged commit 15e3fa7 into main Aug 3, 2025
@jasonacox jasonacox deleted the v0.16.3 branch August 3, 2025 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants