from praisonai.capabilities import image_generateresult = image_generate( prompt="A blue circle on white background", model="dall-e-2", size="256x256", n=1)print(f"URL: {result[0].url}")
from praisonai.capabilities import image_generateresult = image_generate( prompt="A beautiful landscape", model="dall-e-3")# Save to fileresult[0].save("landscape.png")
from praisonai.capabilities import image_generate# Works out of the box — response_format is auto-dropped for gpt-image-*.result = image_generate( prompt="A green pixel art landscape", model="gpt-image-1",)print(result[0].b64_json[:40], "…")
from praisonai.capabilities import image_generate# Pass drop_params=False to raise if any kwarg is unsupported by the model.result = image_generate( prompt="A sunset over mountains", model="dall-e-3", drop_params=False,)print(result[0].url)
The capability wrapper drops parameters a model rejects before calling LiteLLM, so calls succeed without special-casing.
Model family
response_format
Notes
dall-e-3
Dropped by wrapper (OpenAI rejects it)
Always returns URL
gpt-image-* (e.g. gpt-image-1)
Dropped by wrapper (OpenAI rejects it)
Always returns base64
dall-e-2
Honoured
"url" or "b64_json"
Non-OpenAI providers (e.g. stability/...)
Honoured where supported
drop_params=True strips anything unsupported
drop_params=True is injected per call — the global litellm.drop_params is left untouched. The same handling applies to aimage_generate, image_edit, and aimage_edit.