Spaces:
Running
Running
| from abc import ABC, abstractmethod | |
| from pathlib import Path | |
| class FluxAPI(ABC): | |
| """ | |
| Abstract base class for Flux API implementations. | |
| This class defines the common interface for all Flux API implementations. | |
| """ | |
| def name(self) -> str: | |
| """ | |
| The name of the API implementation. | |
| Returns: | |
| str: The name of the specific API implementation | |
| """ | |
| pass | |
| def generate_image(self, prompt: str, save_path: Path) -> float: | |
| """ | |
| Generate an image based on the prompt and save it to the specified path. | |
| Args: | |
| prompt (str): The text prompt to generate the image from | |
| save_path (Path): The path where the generated image should be saved | |
| Returns: | |
| float: The time taken for the API call in seconds | |
| """ | |
| pass | |