|
6 | 6 | from typing import List, Union
|
7 | 7 | from ._config import ClientConfig
|
8 | 8 |
|
| 9 | +class AdvanceConfig(TypedDict): |
| 10 | + negative_prompt: NotRequired[str] |
| 11 | + guidance: NotRequired[int] |
| 12 | + seed: NotRequired[int] |
| 13 | + |
9 | 14 | class ImageGenerationParams(TypedDict):
|
10 | 15 | prompt: Required[str]
|
11 |
| - """" |
12 |
| - The text to generate the image from." |
| 16 | + """ |
| 17 | + The text to generate the image from. |
13 | 18 | """
|
14 | 19 | aspect_ratio: NotRequired[Literal["1:1", "16:9", "21:9", "3:2", "2:3", "4:5", "5:4", "3:4", "4:3", "9:16", "9:21"]]
|
15 | 20 | """
|
16 | 21 | The aspect ratio of the image. The default is 1:1.
|
17 | 22 | """
|
18 | 23 | width: NotRequired[int]
|
19 |
| - """" |
20 |
| - The width of the image. The default is 512." |
| 24 | + """ |
| 25 | + The width of the image. The default is 512. |
21 | 26 | """
|
22 | 27 | height: NotRequired[int]
|
23 | 28 | """
|
24 |
| - The height of the image. The default is 512." |
| 29 | + The height of the image. The default is 512. |
25 | 30 | """
|
26 | 31 | steps: NotRequired[int]
|
27 |
| - """" |
28 |
| - The number of steps to generate the image."" |
29 | 32 | """
|
30 |
| - advance_config: NotRequired[Dict[str, Union[int, str]]] |
| 33 | + The number of steps to generate the image. |
| 34 | + """ |
| 35 | + output_format: NotRequired[Literal["png", "svg"]] |
| 36 | + """ |
| 37 | + The output format of the generated image. Can be 'png' or 'svg'. |
| 38 | + """ |
| 39 | + advance_config: NotRequired[AdvanceConfig] |
31 | 40 | """
|
32 | 41 | The advance configuration for the image generation. The default is None.
|
33 | 42 | You can pass the following:
|
34 |
| - - `seed`: The seed for the image generation. The default is None. |
35 |
| - - `guidance`: The guidance for the image generation. The default is None. |
36 |
| - - `negative_prompt`: The negative prompt for the image generation. The default is None. |
| 43 | + - `negative_prompt`: The negative prompt for the image generation |
| 44 | + - `guidance`: The guidance scale for the image generation |
| 45 | + - `seed`: The seed for reproducible generation |
| 46 | + """ |
| 47 | + url: NotRequired[str] |
| 48 | + """ |
| 49 | + URL to use as image input. |
| 50 | + """ |
| 51 | + file_store_key: NotRequired[str] |
| 52 | + """ |
| 53 | + File store key to use as image input. |
37 | 54 | """
|
38 | 55 |
|
39 | 56 | class ImageGenerationResponse(TypedDict):
|
|
0 commit comments