gpt4free/g4f/client/image_models.py
H Lohaus ffb4b0d162
Improve download of generated images, serve images in the api (#2391)
* Improve download of generated images, serve images in the api
Add support for conversation handling in the api

* Add orginal prompt to image response

* Add download images option in gui, fix loading model list in Airforce

* Add download images option in gui, fix loading model list in Airforce
2024-11-20 19:58:16 +01:00

15 lines
374 B
Python

from __future__ import annotations
from ..models import ModelUtils
class ImageModels():
def __init__(self, client):
self.client = client
self.models = ModelUtils.convert
def get(self, name, default=None):
model = self.models.get(name)
if model and model.best_provider:
return model.best_provider
return default