Spaces:
Running
on
Zero
Running
on
Zero
Update
Browse files
app.py
CHANGED
@@ -28,20 +28,25 @@ def infer(
|
|
28 |
num_inference_steps: int = 28,
|
29 |
progress: gr.Progress = gr.Progress(track_tqdm=True), # noqa: ARG001, B008
|
30 |
) -> tuple[PIL.Image.Image, int]:
|
31 |
-
"""Generate an image from a prompt using the
|
|
|
|
|
|
|
|
|
32 |
|
33 |
Args:
|
34 |
-
prompt:
|
35 |
-
seed: The seed
|
36 |
-
randomize_seed:
|
37 |
-
width:
|
38 |
-
height:
|
39 |
-
guidance_scale:
|
40 |
-
|
41 |
-
|
|
|
42 |
|
43 |
Returns:
|
44 |
-
A tuple containing the generated image and the seed.
|
45 |
"""
|
46 |
if randomize_seed:
|
47 |
seed = random.randint(0, MAX_SEED) # noqa: S311
|
|
|
28 |
num_inference_steps: int = 28,
|
29 |
progress: gr.Progress = gr.Progress(track_tqdm=True), # noqa: ARG001, B008
|
30 |
) -> tuple[PIL.Image.Image, int]:
|
31 |
+
"""Generate an image from a text prompt using the FLUX.1 [dev] model.
|
32 |
+
|
33 |
+
Note:
|
34 |
+
- Prompts must be written in English. Other languages are not currently supported.
|
35 |
+
- Prompts are limited to 77 tokens due to CLIP tokenizer constraints.
|
36 |
|
37 |
Args:
|
38 |
+
prompt: A text prompt in English to guide the image generation. Limited to 77 tokens.
|
39 |
+
seed: The seed value used for reproducible image generation.
|
40 |
+
randomize_seed: If True, overrides the seed with a randomly generated one.
|
41 |
+
width: Width of the output image in pixels. Defaults to 1024.
|
42 |
+
height: Height of the output image in pixels. Defaults to 1024.
|
43 |
+
guidance_scale: Controls how strongly the model follows the prompt.
|
44 |
+
Higher values lead to images more closely aligned with the prompt. Defaults to 3.5.
|
45 |
+
num_inference_steps: Number of denoising steps during generation. Higher values can improve quality. Defaults to 28.
|
46 |
+
progress: (Internal) Progress tracker for UI integration; should not be manually set by users.
|
47 |
|
48 |
Returns:
|
49 |
+
A tuple containing the generated image and the seed value used.
|
50 |
"""
|
51 |
if randomize_seed:
|
52 |
seed = random.randint(0, MAX_SEED) # noqa: S311
|