txt2img_flux

Generate an image with FLUX.1-schnell

Description

4-step distilled text-to-image generation (no classifier-free guidance): T5 + CLIP prompt encoding, flow-matching Euler denoising over the packed latent sequence, and 16-channel VAE decode. With phase offloading each component is the sole GPU tenant for its phase.

Usage

txt2img_flux(prompt, pipeline = NULL, width = 1024L, height = 1024L,
             num_inference_steps = 4L, max_sequence_length = 256L, seed = NULL,
             prompt_embeds = NULL, pooled_prompt_embeds = NULL,
             save_file = TRUE, filename = NULL, verbose = TRUE, ...)

Arguments

  • prompt: Character. The prompt.
  • pipeline: A flux_pipeline from flux_load_pipeline; NULL loads one (passing ... through).
  • num_inference_steps: Integer. Denoising steps (schnell: 4).
  • max_sequence_length: Integer. T5 token length (schnell: 256).
  • seed: Integer or NULL. Initial latents are drawn on the CPU, so a seed matches a Python diffusers run with a CPU generator.
  • save_file: Logical. Write a PNG.
  • filename: Output path (default derived from the prompt).
  • verbose: Logical.
  • ...: Passed to flux_load_pipeline when pipeline is NULL.
  • width,height: Integers, divisible by 16.
  • prompt_embeds,pooled_prompt_embeds: Optional precomputed text embeddings (skip the text encoders).

Value

Invisibly, list(image, metadata) where image is an [H, W, 3] array in [0, 1].