Skip to content

PrunaAI/runpod-worker-FLUX.1-dev

 
 

Repository files navigation

Pruna AI Logo

Simply make AI models faster, cheaper, smaller, greener!

Documentation

Website X (formerly Twitter) URL Devto Reddit Discord Huggingface Replicate GitHub

Pruna AI Logo

FLUX.1-dev Worker Banner


We can optimize any diffusers models and optimized FLUX.1-dev using the following techniques:

FLUX.1-dev-juiced Generated Optimisation techniques


Run an optimized FLUX.1-dev as a serverless endpoint to generate images.

⚠️ Important Notes:

  • Compilation Time: The first request may take 2-3 minutes as the model compiles for optimal performance
  • Warmup Time: Subsequent requests will be faster but may still have a brief warmup period

RunPod


Usage

The worker accepts the following input parameters:

Parameter Type Default Required Description
prompt str None Yes The main text prompt describing the desired image.
negative_prompt str None No Text prompt specifying concepts to exclude from the image
height int 1024 No The height of the generated image in pixels
width int 1024 No The width of the generated image in pixels
seed int None No Random seed for reproducibility. If None, a random seed is generated
num_inference_steps int 25 No Number of denoising steps for the base model
guidance_scale float 7.5 No Classifier-Free Guidance scale. Higher values lead to images closer to the prompt, lower values more creative
num_images int 1 No Number of images to generate per prompt (Constraint: must be 1 or 2)

Example Request

{
  "input": {
    "prompt": "a knitted purple prune",
    "negative_prompt": None,
    "height": 1024,
    "width": 1024,
    "num_inference_steps": 25,
    "guidance_scale": 7.5,
    "seed": 42,
    "num_images": 1
  }
}

which is producing an output like this:

{
  "delayTime": 11449,
  "executionTime": 6120,
  "id": "447f10b8-c745-4c3b-8fad-b1d4ebb7a65b-e1",
  "output": {
    "image_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAIAAADwf7zU...",
    "images": [
      "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAIAAADwf7zU..."
    ],
    "seed": 42
  },
  "status": "COMPLETED",
  "workerId": "462u6mrq9s28h6"
}

and when you convert the base64-encoded image into an actual image, it looks like this:

FLUX.1-dev-juiced Generated Image: 'A knitted purple prune'

About

RunPod worker for FLUX.1-dev

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 85.2%
  • Dockerfile 14.8%