Spaces:
Running
on
Zero
Running
on
Zero
Update
Browse files
app.py
CHANGED
@@ -26,19 +26,23 @@ def infer(
|
|
26 |
num_inference_steps: int = 4,
|
27 |
progress: gr.Progress = gr.Progress(track_tqdm=True), # noqa: ARG001, B008
|
28 |
) -> tuple[PIL.Image.Image, int]:
|
29 |
-
"""Generate an image from a prompt using the FLUX.1 [schnell] model.
|
|
|
|
|
|
|
|
|
30 |
|
31 |
Args:
|
32 |
-
prompt:
|
33 |
-
seed: The seed
|
34 |
-
randomize_seed:
|
35 |
-
width:
|
36 |
-
height:
|
37 |
-
num_inference_steps:
|
38 |
-
progress: Internal
|
39 |
|
40 |
Returns:
|
41 |
-
A tuple containing the generated image and the seed.
|
42 |
"""
|
43 |
if randomize_seed:
|
44 |
seed = random.randint(0, MAX_SEED) # noqa: S311
|
|
|
26 |
num_inference_steps: int = 4,
|
27 |
progress: gr.Progress = gr.Progress(track_tqdm=True), # noqa: ARG001, B008
|
28 |
) -> tuple[PIL.Image.Image, int]:
|
29 |
+
"""Generate an image from a text prompt using the FLUX.1 [schnell] model.
|
30 |
+
|
31 |
+
Note:
|
32 |
+
- Prompts must be in English. Other languages are not currently supported.
|
33 |
+
- Prompts are limited to a maximum of 77 tokens, due to the CLIP tokenizer constraint.
|
34 |
|
35 |
Args:
|
36 |
+
prompt: A text prompt in English used to guide the image generation. Limited to 77 tokens.
|
37 |
+
seed: The seed used for deterministic random number generation.
|
38 |
+
randomize_seed: If True, a new random seed will be used instead of the one provided.
|
39 |
+
width: Width of the generated image in pixels. Defaults to 1024.
|
40 |
+
height: Height of the generated image in pixels. Defaults to 1024.
|
41 |
+
num_inference_steps: Number of inference steps to perform. A higher value may improve image quality. Defaults to 4.
|
42 |
+
progress: (Internal) Used to display progress in the UI; should not be modified by the user.
|
43 |
|
44 |
Returns:
|
45 |
+
A tuple containing the generated image and the seed used.
|
46 |
"""
|
47 |
if randomize_seed:
|
48 |
seed = random.randint(0, MAX_SEED) # noqa: S311
|