Skip to content

feat: add flux-2-max and gpt-image-1.5 models#98

Merged
Kamilbenkirane merged 2 commits into
mainfrom
models/add-flux-2-max-and-gpt-image-1-5
Dec 22, 2025
Merged

feat: add flux-2-max and gpt-image-1.5 models#98
Kamilbenkirane merged 2 commits into
mainfrom
models/add-flux-2-max-and-gpt-image-1-5

Conversation

@Kamilbenkirane

Copy link
Copy Markdown
Member

Adds two new image generation models:

  • flux-2-max: BFL FLUX.2 Max model for image generation
  • gpt-image-1.5: OpenAI GPT Image 1.5 model

Related to:

- Add flux-2-max model to BFL image generation models
- Add gpt-image-1.5 model to OpenAI image generation models
@claude

claude Bot commented Dec 22, 2025

Copy link
Copy Markdown

PR Review: Add flux-2-max and gpt-image-1.5 models

Overview

This PR adds two new image generation models to the Celeste Python SDK. The changes are well-structured and follow existing patterns in the codebase.


✅ Code Quality & Best Practices

Strengths:

  • Consistent with existing patterns: Both model definitions follow the established structure seen in other models (flux-2-pro, dall-e-3, gpt-image-1)
  • Proper imports: All necessary constraint types are correctly imported
  • Good documentation: Inline comments explain model-specific behavior (e.g., "flux-2-max always upsamples prompts")
  • Clean organization: Models are added to the appropriate provider files

Minor Observations:

  1. Model ordering: flux-2-max is added before flux-2-pro in the MODELS list. Consider if there's a preferred ordering convention (e.g., chronological, alphabetical, or by capability tier). Looking at the OpenAI models, they appear roughly chronological.

  2. Display name formatting: The naming is inconsistent across the codebase:

    • BFL models use bracket notation: FLUX.2 [max], FLUX.2 [pro]
    • OpenAI models use plain text: GPT Image 1.5, DALL-E 3

    This is fine as it reflects provider branding, but worth noting.


🐛 Potential Issues

flux-2-max (packages/capabilities/image-generation/src/celeste_image_generation/providers/bfl/models.py:9-36):

  1. ⚠️ Duplicate constraint definitions: The dimension constraints, presets, seed, safety_tolerance, and output_format are identical to flux-2-pro (lines 37-63). This creates maintenance burden - if these constraints change, they need updating in multiple places.

    Recommendation: Consider extracting common constraints into a shared constant:

    _FLUX_2_COMMON_DIMENSIONS = Dimensions(
        min_pixels=64 * 64,
        max_pixels=2048 * 2048,
        min_aspect_ratio=9 / 21,
        max_aspect_ratio=21 / 9,
        presets={...}
    )
  2. ℹ️ Comment about grounding search: Line 31 mentions "Includes grounding search for real-time information integration" but this isn't reflected in the parameter constraints. This appears to be a model capability that's always enabled (like prompt upsampling), which is fine, but the comment could be clearer about whether this requires any API configuration.

gpt-image-1.5 (packages/capabilities/image-generation/src/celeste_image_generation/providers/openai/models.py:60-72):

  1. streaming=False: Good catch setting this explicitly. Consistent with the model's capabilities.

  2. ⚠️ Parameter constraints match gpt-image-1: The constraints are identical to gpt-image-1 (lines 34-42) except for the streaming capability. This raises a question: what differentiates v1.5 from v1? Is it quality, speed, or features not exposed in the API parameters?

  3. Missing PARTIAL_IMAGES parameter: Both gpt-image-1 and gpt-image-1-mini support PARTIAL_IMAGES: Range(min=0, max=3) (lines 35, 50). Should gpt-image-1.5 support this as well, or is its non-streaming nature the reason for omitting it?


🔒 Security Concerns

No security issues identified

  • Using established constraint types prevents injection attacks
  • No dynamic code execution or unsafe operations
  • Parameters are properly validated through the constraint system

⚡ Performance Considerations

No performance concerns

  • Model definitions are loaded once at import time
  • No computational overhead in the additions
  • Constraint validation is efficient

🧪 Test Coverage

⚠️ Missing test coverage for new models

The integration test at packages/capabilities/image-generation/tests/integration_tests/test_image_generation/test_generate.py includes test cases for:

  • flux-2-pro (BFL)
  • dall-e-2 (OpenAI)
  • imagen-4.0-fast-generate-001 (Google)
  • seedream-4-0-250828 (BytePlus)

Recommendations:

  1. Add integration test cases for the new models:

    (Provider.BFL, "flux-2-max", {"aspect_ratio": "1024x1024"}),
    (Provider.OPENAI, "gpt-image-1.5", {"aspect_ratio": "1024x1024", "quality": "medium"}),
  2. The models should be tested to verify:

    • Model registration works correctly
    • Parameters are properly constrained
    • Image generation completes successfully
    • Output format matches expectations

📋 Summary

Verdict: ✅ Approve with minor recommendations

The code is production-ready and follows established patterns. The main suggestions are:

  1. High Priority: Add integration tests for both new models
  2. Medium Priority: Consider DRYing up duplicate constraints in BFL models
  3. Low Priority: Clarify the differences between gpt-image-1.5 and gpt-image-1 (especially around PARTIAL_IMAGES support)

The additions are safe to merge, though test coverage would strengthen confidence in the implementation.


📚 Additional Context

Based on the PR links:

It would be helpful to verify the parameter constraints against the actual API documentation to ensure completeness.

Bump celeste-ai and celeste-image-generation versions to 0.3.5
@claude

claude Bot commented Dec 22, 2025

Copy link
Copy Markdown

Pull Request Review: Add flux-2-max and gpt-image-1.5 models

Summary

This PR adds two new image generation models to the Celeste AI platform:

  • flux-2-max: BFL FLUX.2 Max model with comprehensive parameter constraints
  • gpt-image-1.5: OpenAI GPT Image 1.5 model

Overall, the implementation is clean and follows established patterns in the codebase. The code quality is good with minor suggestions below.


Code Quality & Best Practices ✅

Strengths:

  1. Consistent with existing patterns: Both model definitions follow the exact structure used in other models in their respective files
  2. Good documentation: Inline comments explain model-specific behaviors (e.g., "flux-2-max always upsamples prompts")
  3. Clear parameter constraints: All parameters use appropriate constraint types (Dimensions, Choice, Range, Int)
  4. Proper type annotations: Uses list[Model] type hints consistently

Minor Suggestions:

1. Version Bumping Strategy (packages/capabilities/image-generation/pyproject.toml:3)

The version was bumped from 0.3.3 to 0.3.5, skipping 0.3.4. While this works, it's worth confirming:

  • Is there a reason for skipping 0.3.4?
  • Consider documenting version bumping strategy in the repo if not already present

2. Streaming Parameter Inconsistency (packages/capabilities/image-generation/src/celeste_image_generation/providers/openai/models.py:63)

The gpt-image-1.5 model sets streaming=False, but the similar gpt-image-1 and gpt-image-1-mini models set streaming=True.

Question: Is this intentional? If GPT Image 1.5 doesn't support streaming, this is correct. Otherwise, this might be an oversight.

Compare:

  • Line 33: gpt-image-1 has streaming=True
  • Line 48: gpt-image-1-mini has streaming=True
  • Line 63: gpt-image-1.5 has streaming=FalseDifferent

Potential Bugs or Issues ⚠️

flux-2-max Preset Validation

The flux-2-max model has extensive dimension presets (packages/capabilities/image-generation/src/celeste_image_generation/providers/bfl/models.py:19-28):

presets={
    "Square 1K": "1024x1024",
    "Square 2K": "2048x2048",
    "HD 16:9": "1920x1080",
    ...
}

Verification needed: Ensure all preset dimensions fall within the declared constraints:

  • min_pixels=64*64 (4,096)
  • max_pixels=2048*2048 (4,194,304)
  • ✅ Aspect ratios between 9/21 (~0.429) and 21/9 (~2.333)

Quick check of presets:

  • "Square 2K" (2048x2048) = 4,194,304 pixels ✅ (exactly at max)
  • "Ultra-wide 21:9" (1920x832) = aspect ratio 2.307 ✅ (within bounds)
  • "Portrait 9:21" (832x1920) = aspect ratio 0.433 ✅ (within bounds)

All presets appear valid! 👍


Performance Considerations 🚀

No performance concerns identified:

  • Model definitions are static data structures loaded at import time
  • No runtime overhead introduced
  • Follows existing lightweight architecture (no vendor SDKs)

Security Concerns 🔒

No security issues detected:

  • No user input handling in model definitions
  • No API keys or sensitive data
  • No code execution paths
  • Pure data definitions using type-safe constraints

Test Coverage 📊

Current State:

Looking at the integration test (packages/capabilities/image-generation/tests/integration_tests/test_image_generation/test_generate.py:8-16), it tests:

  • BFL: flux-2-pro
  • OpenAI: dall-e-2
  • Google: imagen-4.0-fast-generate-001
  • BytePlus: seedream-4-0-250828

Recommendation:

Consider adding integration tests for the new models:

@pytest.mark.parametrize(
    ("provider", "model", "parameters"),
    [
        # Existing tests...
        (Provider.BFL, "flux-2-max", {"aspect_ratio": "1024x1024", "safety_tolerance": 3}),
        (Provider.OPENAI, "gpt-image-1.5", {"aspect_ratio": "1024x1024", "quality": "medium"}),
    ],
)

Note: This is optional but would provide additional confidence, especially for parameter constraint validation.


Additional Observations

  1. Documentation: The PR description includes helpful links to the model pages on withceleste.ai - good practice for reviewers to verify model specifications

  2. Minimal diff: The PR touches only 4 files with focused changes - excellent for reducing merge conflicts and review burden

  3. No breaking changes: This is a pure addition of new models with no modifications to existing functionality


Final Verdict: ✅ Approve with Minor Questions

This PR is well-structured and safe to merge. The only items to address before merging:

  1. Clarify: Is the version jump from 0.3.3 → 0.3.5 intentional?
  2. Verify: Is streaming=False correct for gpt-image-1.5 (vs other gpt-image models)?

Both are likely intentional, but worth confirming. Great work! 🎉

@Kamilbenkirane Kamilbenkirane merged commit b87d791 into main Dec 22, 2025
11 checks passed
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.

1 participant