eve / gemini_flash_lib /README.md
Chandima Prabhath
gemini flash image edit
3380d86

A newer version of the Gradio SDK is available: 5.38.0

Upgrade

Flux Kontext Image Generator Library

A Python library for interacting with the Kontext Chat image generation API.

Installation

pip install requests

Usage

from flux_kontext_lib import generate_image

# Using file path
result = generate_image("close her eyes", "path/to/image.jpg")

# Using image bytes
with open("path/to/image.jpg", "rb") as f:
    image_bytes = f.read()
result = generate_image("add sunglasses", image_bytes)

# Custom headers
custom_headers = {"Authorization": "Bearer YOUR_TOKEN"}
result = generate_image("make it sunny", "path/to/image.jpg", headers=custom_headers)

Parameters

  • prompt_text (str): Text prompt for image modification
  • image_input (str or bytes): Image file path or bytes content
  • headers (dict, optional): Custom request headers

Returns

  • dict: API response on success
  • None: On request failure

Error Handling

Raises:

  • FileNotFoundError: If image file doesn't exist
  • ValueError: For unsupported input types

Example

See example_usage.py for a complete usage example.