1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const axios = require('axios');
const FormData = require('form-data');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/flux-krea-dev";
const reqBody = {
"seed": 42,
"prompt": "A miniature raccoon explorer made of wool wearing all kinds of equipment, the whole world is made of felt textile, holding a signboard which says 'Flux krea dev on Segmind'",
"go_fast": true,
"guidance": 3,
"megapixels": 1,
"num_outputs": 2,
"aspect_ratio": "16:9",
"output_format": "jpg",
"output_quality": 90,
"prompt_strength": 0.7,
"num_inference_steps": 40,
"disable_safety_checker": false
};
(async function() {
try {
const formData = new FormData();
// Append regular fields
for (const key in reqBody) {
if (reqBody.hasOwnProperty(key)) {
formData.append(key, reqBody[key]);
}
}
// Convert and append images as Base64 if necessary
const response = await axios.post(url, formData, {
headers: {
'x-api-key': api_key,
...formData.getHeaders()
}
});
console.log(response.data);
} catch (error) {
console.error('Error:', error.response ? error.response.data : error.message);
}
})();
The seed ensures reproducibility. Use specific numbers for consistent results or leave random for variability.
Input an image to guide the output. Match aspect ratio to maintain consistency; use any for unique results.
Guide the AI with text for the image generation. Short and imaginative prompts work best; imaginative scenes suggest detailed descriptions.
Enable faster predictions; less deterministic but quicker. Disable for exact replication and improved detail.
Controls adherence to prompt. Increase for more accuracy; decrease for creative variance.
min : 0,
max : 10
Choose resolution size. Use '1' for high-quality or '0.25' for faster, lower-resolution outputs.
Allowed values:
Set the number of images generated. Choose more for variability or single for speed.
min : 1,
max : 4
Decide image proportions. Use '1:1' for square or other ratios for landscapes or portraits.
Allowed values:
Select image format. Use 'webp' for web-friendly, 'jpg' for compression, or 'png' for quality.
Allowed values:
Set image saving quality. Choose 100 for best or lower for smaller file size.
min : 0,
max : 100
Defines prompt influence in img2img mode. High values alter original image more significantly.
min : 0,
max : 1
Adjust the number of processing steps. Higher gives better quality; lower speeds up.
min : 1,
max : 50
Toggle safety checker to allow all image outputs. Disable to maximize creative freedom.
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
FLUX.1 Krea is an open-source, 12 billion-parameter generative AI model designed for photorealistic image synthesis with fine-grained aesthetic control. Developed in collaboration with Black Forest Labs, FLUX.1 Krea was trained in two stages: first on a diverse “flux-dev-raw” foundation, then refined via supervised fine-tuning on curated high-quality images, followed by reinforcement learning from human feedback (RLHF). The result is a model that avoids common “AI look” artifacts—such as blurred backgrounds or unnatural textures—while delivering coherent, visually compelling outputs aligned to your creative vision.
• 12 B Parameter Foundation: Rich representation capacity for complex scenes and nuanced styles.
• Two-Stage Post-Training: Supervised fine-tuning on premium imagery plus RLHF to boost style fidelity and robustness.
• Aesthetic Control: Adjustable guidance scale (0–10) ensures you can trade off creativity for prompt adherence.
• Reproducibility: Use the seed
parameter (default 42) to generate identical results across runs.
• Flexible Resolution: Choose megapixels
(0.25 for speed, 1 for high-res) and aspect_ratio
presets (e.g., 16:9, 1:1).
• Performance Modes: Toggle go_fast
for quicker, less deterministic renders or disable for full-quality outputs.
• Safety Checker: Optionally disable content filtering to maximize creative freedom (disable_safety_checker=false
by default).
• Concept Art & Illustration: Rapidly explore styles and compositions for storyboards, comics, and books.
• Product & Packaging Mockups: Generate photorealistic renders to visualize prototypes without a camera.
• Marketing & Advertising Assets: Craft cohesive imagery for campaigns, social media, and landing pages.
• Architectural & Interior Visualization: Produce lifelike room layouts and exterior shots aligned to design specs.
• UI/UX Backgrounds & Assets: Create seamless textures, patterns, and environment renders for digital products.
seed
parameter to reproduce results; omit or randomize for novel variations.1
MP for high fidelity or 0.25
MP to speed up; set aspect_ratio
to match your layout.image
URI for img2img workflows; adjust prompt_strength
(0–1) to control transformation.Q: Is FLUX.1 Krea fully open-source?
Yes. The model weights, training scripts, and documentation are available under an open-source license.
Q: How do I avoid “blurry” outputs?
Increase num_inference_steps
and set megapixels
to 1. Higher guidance (8+) also sharpens details.
Q: Can I generate multiple images per prompt?
Use num_outputs
(1–4). Generating 2–4 variants helps you choose the best composition.
Q: What formats does FLUX.1 Krea support?
Select output_format
from jpg
, png
, or webp
. JPEG is default for balanced quality and file size.
Q: How does RLHF improve results?
Reinforcement learning from human feedback refines style consistency, reduces artifacts, and aligns outputs with aesthetic preferences.