Tutorial
How to Set Up FLUX 3 Open Source for Client Image Generation
Step-by-step guide to running FLUX 3 locally and using it to deliver custom AI images for agency clients.
If you're an agency owner, you know the drill: clients want fresh visuals for campaigns, but custom photography is slow and expensive. FLUX 3 changes that. It's the first open-source text-to-image model that actually looks like a professional designer made it. In this tutorial, I'll show you how to set it up on your own hardware and start generating client-ready images in under 30 minutes.
Prerequisites
Before we start, make sure you have:
- A GPU with at least 8GB VRAM (NVIDIA RTX 3070 or better works).
- Python 3.10 or higher installed.
- Git installed.
- A Hugging Face account and access token (free tier is fine).
- Basic command line knowledge.
If you don't have a beefy GPU, you can rent one from Lambda Labs, RunPod, or Vast.ai for around $0.50/hour. For an agency, that's nothing compared to a single photoshoot.
What You'll Build
By the end of this tutorial, you'll have a local image generation script. You give it a prompt like 'premium coffee packaging, minimal design, studio lighting' and it outputs a high-resolution 1024x1024 image. You can run it locally, batch it, and integrate it into your delivery pipeline. No API keys, no recurring fees, no data leaving your machine.
Step 1: Setup
Create a project folder and spin up a Python environment.
mkdir flux3-studio && cd flux3-studio
python -m venv venv
source venv/bin/activateNow install PyTorch and the diffusers library. Use the CUDA version that matches your GPU driver. This one works for CUDA 12.1:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
pip install diffusers transformers accelerate pillowThat's it for dependencies. FLUX 3 is fully supported by the diffusers pipeline, so you don't need to build anything from source.
Step 2: Core Implementation
Now we need to download the model and load it into memory. Create a file called generate.py in your project folder.
from diffusers import FluxPipeline
import torch
pipe = FluxPipeline.from_pretrained(
'black-forest-labs/FLUX.3-open',
torch_dtype=torch.bfloat16
)
pipe.to('cuda')If you're working with a consumer GPU, you can enable CPU offloading to fit the model into memory:
pipe.enable_sequential_cpu_offload()Now for the generation part. Append this to generate.py:
prompt = 'professional product photo of artisanal coffee bag, warm lighting, clean background'
image = pipe(
prompt,
width=1024,
height=1024,
guidance_scale=3.5,
num_inference_steps=40,
).images[0]
image.save('client_mockup.png')
print('Image saved to client_mockup.png')You can change guidance_scale and num_inference_steps. FLUX 3 works well at lower steps than previous models, so 40 is plenty for high quality output.
Step 3: Testing & Verification
Run the script:
python generate.pyIf your setup is correct, you'll see a progress bar and then a file named client_mockup.png appear in your project folder. Open it and check for:
- Correct subject matter and composition.
- No obvious artifacts or distortions.
- Sharp text if your prompt includes text.
FLUX 3 is especially good at rendering legible text, which matters for agency clients who need packaging designs or social media posts with headlines.
Try a few more prompts to see the range:
prompts = [
'modern office interior, natural light, corporate brochure style',
'healthy meal prep bowl, top-down flat lay, bright background',
'luxury watch on marble surface, dramatic shadows, commercial product shot',
]
for i, p in enumerate(prompts):
image = pipe(p, width=1024, height=1024, guidance_scale=3.5, num_inference_steps=40).images[0]
image.save(f'client_mockup_{i}.png')If all images look solid, you're ready to use FLUX 3 in real client work.
Troubleshooting
Out of memory
If you hit a CUDA out-of-memory error, use enable_sequential_cpu_offload() instead of pipe.to('cuda'). It's slower, but it runs on 8GB cards. You can also reduce the image size to 768x768 and use 30 steps.
Model download is slow
The model is about 12GB. Make sure your internet connection is stable. You can also set the environment variable HF_HUB_ENABLE_HF_TRANSFER=1 after installing hf-transfer to speed up downloads.
Auth token error
FLUX 3 requires accepting the license on Hugging Face. Visit the model page, sign in, and agree to the terms. Then log in from the command line:
huggingface-cli loginPaste that access token and retry.
Black images
Downloaded images but they're pure black? That usually means a dtype mismatch. Make sure you load the model with torch_dtype=torch.bfloat16 and not torch.float16.
Next Steps
Once you have the basic script running, here's how to turn it into an agency service:
- Add an image upscaler like
RealESRGANto bump 1024x1024 output to high-res print size. - Create a FastAPI wrapper around your script so your team can generate images from a simple URL.
- Connect it to n8n or Zapier to trigger image generation automatically when a client submits a form or approves a concept.
- Batch generate variations by passing in different prompts from a CSV file. This lets you offer clients 10 creative concepts before lunch.
FLUX 3 is open source. That means you own the pipeline, not the model provider. You can iterate, use it in multiple projects, and charge for the output without worrying about API quotas or per-image fees.
For agency owners, the practical takeaway is simple: custom imagery is no longer a slow, expensive bottleneck. Set up FLUX 3 once, and you'll be delivering client mockups in minutes — not weeks.
Related Reading
Playbook
The Playbook for Open-Source Video Models: What Minimax 3 Means for Client Automations
Prepare for the open-source video wave and use models like Minimax 3 in your client automation stack.
Playbook
Scrape Your Way to Smarter Clinic Automation: What a New Open-Source Framework Means for SMBs
How a trending open-source scraping tool can give clinic operators real-time competitor intel and feed your automation stack.