hysts HF Staff commited on
Commit
da11108
·
1 Parent(s): 2a7c9a8
Files changed (1) hide show
  1. app.py +13 -9
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: The prompt to generate an image from.
33
- seed: The seed to use for the random number generator.
34
- randomize_seed: Whether to randomize the seed.
35
- width: The width of the image to generate. Defaults to 1024.
36
- height: The height of the image to generate. Defaults to 1024.
37
- num_inference_steps: The number of inference steps to use. Defaults to 4.
38
- progress: Internal parameter used to display progress in the UI. This should not be set manually by the user.
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