A Python client for the Adobe Firefly API, created using the Adobe Firefly API Documentation.
- Authenticate with Adobe Firefly using client ID and secret
- Automatically handles access token retrieval and refresh
- Generate images from text prompts
- Simple, extensible interface
- Python 3.10+
requestslibrary
from firefly import FireflyClient
client = FireflyClient(
client_id="your-firefly-client-id",
client_secret="your-firefly-client-secret"
)
response = client.generate_image(prompt="a realistic illustration of a cat coding")
print("Generated image URL:", response.outputs[0].image.url)
print("Seed:", response.outputs[0].seed)
print("Size:", response.size)
print("Content class:", response.contentClass)-
FireflyClient(client_id, client_secret, timeout=30)- Main entry point. Handles authentication and requests.
-
generate_image(prompt: str, **kwargs) -> FireflyImageResponse- Generate an image from a text prompt. Returns a response object with attributes matching the API response (including outputs, size, contentClass, etc).
- Additional keyword arguments are passed as parameters to the API.
FireflyAuthError: Raised for authentication/token errorsFireflyAPIError: Raised for general API errors or unexpected responses