hysts HF Staff commited on
Commit
b2a74a5
·
1 Parent(s): 8654565
Files changed (1) hide show
  1. app.py +15 -10
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 Flux.1 [dev] model.
 
 
 
 
32
 
33
  Args:
34
- prompt: The prompt to generate an image from.
35
- seed: The seed to use for the image generation.
36
- randomize_seed: Whether to randomize the seed.
37
- width: The width of the image. Defaults to 1024.
38
- height: The height of the image. Defaults to 1024.
39
- guidance_scale: The guidance scale to use for the image generation. Defaults to 3.5.
40
- num_inference_steps: The number of inference steps to use for the image generation. Defaults to 28.
41
- progress: Internal parameter used to display progress in the UI. This should not be set manually by the user.
 
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