xtekky / gpt4free

The official gpt4free repository | various collection of powerful language models
https://g4f.ai
GNU General Public License v3.0
62.22k stars 13.39k forks source link

FIX: Bug fix for flux-pro aka flux-schnell #2424

Closed ufoptg closed 13 hours ago

ufoptg commented 14 hours ago

https://api.airforce/imagine2?model=flux-4o

https://api.airforce/imagine2?model=flux-schnell and https://api.airforce/imagine2?model=flux-1.1-pro

all generate same images but "Flux-1.1-Pro" doesnt work

github-actions[bot] commented 13 hours ago

g4f Copilot Review

Thanks @TrueSaiyan for contributing to the project! This is a valuable fix.

The change to lowercase flux-1.1-pro in additional_models_imagine and the get_models method addresses the inconsistency identified in the pull request description. The provided links demonstrating the issue are helpful in understanding the context of the fix.

The diff is clean and straightforward.

Suggestion:

While the fix works, it might be beneficial to add a test case to ensure this specific model name remains consistent in the future. This would prevent regressions if the API or naming conventions change. Consider adding a unit test to verify that Airforce.get_models() returns the expected lowercase version of "flux-1.1-pro" when "flux-pro" is requested.

Overall:

The fix is approved and ready to merge. Adding a test would further improve the code's robustness.