SuperAPI AI Directory

How was the open-source model FLUX.1-Krea [dev] trained?

Author: AI小集 · Original source: AI工具集

FLUX.1-Krea [dev] is an open-source AI image generation model that, through a unique "post-training" process, successfully eliminates the common "AI feel" in traditional AI images and achieves photographic realism. The core training method includes two stages: first, throughsupervised fine-tuning (SFT), the model "re-learns" on a high-quality image dataset carefully selected by humans, laying the foundation for its aesthetics; then, throughreinforcement learning from human feedback (RLHF), the model learns from human preference rankings of generated images, further refining its aesthetic taste. The entire process makes AI-generated images no longer look like they were generated by AI, but more natural, realistic, and artistically appealing.

FLUX.1 Krea [dev]

Revealing the training of the FLUX.1-Krea [dev] model: how to create photographic realism

Core goal: break the "AI feel" and pursue natural aesthetics

The core goal is to completely break the "AI feel" and pursue an unprecedented photographic realism and natural aesthetics. The model was jointly developed by Black Forest Labs and Krea AI. Through innovative training methods, it makes AI-generated images more visually realistic and aesthetically closer to human preferences, redefining the standards of AI image generation.

The mission of FLUX.1-Krea [dev]

"Make AI-generated images no longer look like they were generated by AI, but achieve photographic realism and delicate texture."

 The definition and manifestations of the "AI feel"

The "AI feel" is not a single technical flaw, but a combination of a series of visual features that together form the unique imprint of AI-generated images. According to the technical report officially released by Krea AI, these features mainly include oversaturated colors, unnatural lighting and background blur, and plastic-like materials and textures. The root of the problem is that many models overly pursue the optimization of technical metrics and benchmarks during training, ignoring the complexity and diversity of real-world images.

  • Oversaturated colors: Oversaturated colors are one of the most intuitive manifestations of the "AI feel." When generating images, many AI models tend to use colors that are more vivid and intense than those in the real world in order to attract attention. Although this processing method can create dreamlike or surreal visual effects in some cases, it appears particularly jarring in scenes pursuing photographic realism. For example, the blue of the sky may become too pure, the green of the grass may appear too bright, and the skin tones of people may also lose their natural ruddiness, showing an unhealthy sallow or pale appearance. This color distortion not only destroys the realism of the image, but also makes the entire picture appear too "perfect," thereby exposing traces of AI generation.

One of the training goals of FLUX.1-Krea [dev] is to make the colors of generated images rich and harmonious through fine color adjustment, avoiding overly saturated or uncoordinated colors, thereby getting closer to the visual experience of the real world.

  • Unnatural lighting and background blur: Light and shadow are key elements in shaping an image's sense of three-dimensionality and atmosphere, yet the "AI feel" often falls short in handling light and shadow. AI-generated images frequently exhibit issues such as unnatural light-shadow transitions, overexposed highlights, and crushed blacks in shadows. For example, the direction and intensity of light sources may be inconsistent, leading to logical errors in object shadows; or, to emphasize the subject, the background may be excessively blurred, creating an unrealistic depth-of-field effect that often lacks the optical characteristics of real camera lenses and appears overly smooth and uniform. The handling of reflective materials such as metal and glass also frequently runs into problems, with reflections often being fixed and not varying with the environment, lacking the complexity and dynamism of the real world.

FLUX.1-Krea [dev] is trained by introducing high-quality real light-and-shadow data and applying advanced algorithms, striving to make the transition between light and shadow natural and smooth, avoiding harsh edges and unnatural highlights, and creating a more realistic image with a richer sense of layering.

  • Plastic-feeling materials and textures: The realism of materials and textures is another important factor determining how lifelike an image is. When generating object surfaces, many AI models exhibit a "plastic feel" or "waxy feel," lacking the fine texture and tactile quality of real materials. For example, a person's skin may look overly smooth, without pores, fine lines, or other real skin texture; clothing fabric may lack fibrous texture and look as if made of plastic or rubber; and the surfaces of natural materials such as wood and stone may also lose their distinctive textures and imperfections, appearing overly perfect and artificial. This distortion in materials makes objects look like toy models rather than items in the real world.

FLUX.1-Krea [dev]'s training process places special emphasis on learning real materials and textures. Through refined data selection and model optimization, it strives to restore the real texture of skin, the soft feel of fabric, and the unique details of various natural materials, eliminating this "plastic feel."

Technical Depth: Two Core Training Methods

FLUX.1-Krea [dev] adopts two advanced post-training techniques: Supervised Fine-Tuning (SFT) and Reinforcement Learning from Human Feedback (RLHF). These two techniques complement each other and together form the core of FLUX.1-Krea [dev]'s refined polishing.

Supervised Fine-Tuning (SFT)

Supervised Fine-Tuning (SFT) is the first stage of FLUX.1-Krea [dev]'s post-training pipeline and the foundation for shaping its aesthetic tendencies. Unlike the pretraining stage, which involves broad learning on massive, diverse data, the core of the SFT stage lies in "refinement" rather than "quantity." The development team carefully selected a relatively small but extremely high-quality image dataset, and every image in the dataset underwent strict screening to ensure it met extremely high aesthetic standards in aspects such as light and shadow, color, composition, and detail. By fine-tuning the model on this high-quality dataset, it can effectively guide the model to learn and imitate these "good" image features and break away from various "bad" habits that may exist from the pretraining stage, such as generating blurry, distorted, or stylistically inconsistent images. This process is like having an apprentice who has already mastered basic painting techniques copy the works of masters, rapidly improving their artistic attainment and aesthetic level.

Learning again on high-quality data

The purpose of SFT is to use a carefully curated "special tutoring" to correct various biases that the model may have developed during the pretraining stage and inject specific aesthetic tastes into it. In the training of FLUX.1-Krea [dev], the development team manually selected a high-quality image dataset that met its aesthetic standards. These images are exemplary in terms of fineness, lighting and shadow effects, and compositional proportions. By learning from these "textbook"-level images, the model can gradually internalize these excellent visual features and, in subsequent generation processes, more stably and reliably output images with photorealistic realism and natural beauty.

Application of Classifier-Free Guidance (CFG)

In the SFT stage, the training of FLUX.1-Krea [dev] also introduced a key technique: Classifier-Free Guidance (CFG). CFG is a technique widely used in diffusion models. Its main role is to improve the correlation between generated images and text prompts, enabling the model to more accurately understand and execute user instructions.

  • The role of CFG: improving the correlation between generated images and text prompts,The core role of Classifier-Free Guidance (CFG) is to enhance the diffusion model's ability to understand and execute text prompts. In standard diffusion models, the generation process mainly relies on a denoising network, which predicts and removes noise based on the current noisy image and the text prompt. In some cases, the model may ignore the text prompt and generate images inconsistent with the description. CFG introduces an "unconditional" generation path (i.e., without inputting a text prompt), compares it with the "conditional" generation path (i.e., with the text prompt input), and thereby guides the model to pay more attention to the information in the text prompt. Specifically, CFG calculates the difference between the conditional and unconditional generation results and uses this difference as an additional guidance signal to correct the denoising process. By adjusting the CFG scale (guidance scale), users can control the degree to which the model follows the text prompt. A higher CFG scale makes the model follow the text prompt more strictly, but may lead to a decline in image quality; a lower CFG scale gives the model greater creative freedom, but may deviate from the text description.

FLUX.1-Krea [dev] finds an optimal balance point by fine-tuning on the CFG distribution, which can both ensure the high quality of generated images and ensure that they are highly relevant to the user's text prompt.

  • Custom loss function: directly fine-tuning on the CFG distribution, since the base model of FLUX.1-Krea [dev] flux-dev-raw is a model that has undergone "guided distillation" and already contains the CFG mechanism internally, traditional fine-tuning methods may not be directly applicable. In order to fully utilize and further optimize this characteristic during fine-tuning, the development team designed a custom loss function that enables training directly on the CFG distribution. The design of this custom loss function is a technical innovation in the training process of FLUX.1-Krea [dev]. It allows the model, during the SFT stage, not only to learn the aesthetic features of high-quality images, but also to simultaneously learn how to better generate images under the CFG framework. This means that during fine-tuning, each optimization step directly affects the final generation result guided by CFG, making the fine-tuning effect more direct and significant. This method not only improves the model's aesthetic performance, but also enhances its robustness in following text prompts, laying a solid foundation for the subsequent RLHF stage.

Reinforcement Learning from Human Feedback (RLHF)

The Reinforcement Learning from Human Feedback (RLHF) stage instilled a soul into it, enabling the model to truly learn "aesthetics." RLHF is an advanced machine learning paradigm that directly incorporates human judgment and preferences into the model's training process. In the RLHF stage, the development team no longer relies solely on static datasets, but instead introduces a dynamic, human-involved feedback loop. They invite a professional annotation team to compare multiple images generated by the model pairwise and select the one they believe better meets aesthetic standards. These human-made preference choices are used to build a reward model, which can predict what kind of images are more likely to win human favor.

Through reinforcement learning algorithms, the FLUX.1-Krea [dev] model continuously adjusts its generation strategy to maximize the score given by the reward model. Through multiple rounds of such iterative optimization, the model gradually learns how to generate images that better align with human aesthetic preferences, reaching new heights in realism and aesthetics.

Involving humans in teaching: In the RLHF training process, humans play the role of "teacher," "teaching" the model what is good and what is bad by providing feedback. Specifically:

  • First, start from a pretrained model (such as FLUX.1-Krea [dev] after SFT) and generate a batch of different images;
  • Then, show these images in pairs to human annotators and let them choose according to their own aesthetic preferences;
  • Next, use these preference-labeled data to train a reward model, which can learn to predict the degree of human preference for different images;
  • Finally, use a reinforcement learning algorithm (such as PPO) to update the parameters of the generative model based on feedback from the reward model, generating images that better match human preferences.

Through multiple rounds of such iteration, the model can gradually internalize human aesthetic standards and make wiser, more human-expectation-aligned choices when generating images.

Tuned Preference Optimization (TPO)

TPO is a specific implementation under the RLHF framework, with the goal of further improving the model's aesthetic quality and stylized performance. Compared with standard RLHF methods, TPO may have made specific adjustments and optimizations in the design of the reward model, the choice of reinforcement learning algorithm, or the setting of optimization objectives, so as to better adapt to the specific task of image generation. By applying TPO technology, FLUX.1-Krea [dev] can more effectively use human feedback data and achieve more refined improvements in aesthetic performance. The development team emphasizes that they use high-quality internal preference data and conduct multiple rounds of preference optimization to ensure that the model can stably generate images with high aesthetic value.

  • The role of TPO: To further enhance the model's aesthetics and stylization, after the SFT stage, the model already possesses the foundational capability to generate high-quality images, but its aesthetic "taste" may not yet be stable and mature enough. TPO introduces human preference data to finely "polish" the model's generated results. Specifically, TPO technology helps the model better understand subtle human preferences in aspects such as lighting and shadow, color, composition, and detail. For example, human annotators may prefer images with soft light-and-shadow transitions and harmonious, natural colors, and dislike those with excessively high contrast or overly garish colors. Through TPO optimization, the model can learn to suppress the generation of images that do not conform to human preferences and generate more images that align with human aesthetics. TPO helps improve the model's stylization capability, enabling it to better understand and generate images with specific artistic styles (such as oil painting, watercolor, photography, etc.), meeting users' more diverse creative needs.
  • Multi-round preference optimization: Refining the style and quality of model outputs. To ensure that FLUX.1-Krea [dev] achieves the ultimate aesthetic standard, the development team adopted a multi-round preference optimization strategy during the RLHF stage. This means that the RLHF process is not completed in one go, but undergoes multiple iterations. In each round of optimization, the team collects new preference data and updates the reward model and the generative model. This multi-round optimization approach allows the model to gradually and progressively improve its aesthetic performance. Each round of optimization is like giving the model a "fine-tuning," making its stylized performance more refined and its quality control more stable. Through multiple rounds of iteration, the model can continuously learn from human feedback, gradually correcting various subtle flaws that may appear during generation, ultimately reaching a very high aesthetic level. This pursuit-of-perfection training approach is the key to why FLUX.1-Krea [dev] stands out among numerous AI image generation models.

Training Pipeline: Fine-Grained Refinement from Pre-Training to Post-Training

Pre-Training Stage: Laying a Solid Foundation

The pre-training stage is the cornerstone of the entire training pipeline of FLUX.1-Krea [dev]. At this stage, the model needs to be trained on an extremely large, unfiltered image dataset. This dataset may contain various images scraped from the internet, covering different themes, styles, resolutions, and qualities. By learning on such a massive amount of data, the model can establish a comprehensive cognition of the visual world. It will learn the shapes, colors, and textures of various objects, understand the layout and light-shadow relationships of different scenes, and even grasp some basic artistic styles and composition rules.

The goal of the pre-training stage is to equip the model with strong generalization ability, that is, the ability to understand and generate entirely new image content that it has never seen before.

Post-Training Stage: Shaping a Unique Aesthetic

At this stage, the development team's focus is no longer on letting the model learn more knowledge, but on adjusting and removing undesirable parts of the data distribution, guiding the model toward the aesthetic region they consider "ideal." This process is called "mode collapse," but here it is deliberately and controllably applied to achieve the purpose of improving aesthetic quality.

The post-training stage mainly includes two core steps: supervised fine-tuning (SFT) and reinforcement learning from human feedback (RLHF). Through the synergistic effect of these two steps, the model gradually sheds various "bad" habits that may exist from the pre-training stage, such as generating blurry, distorted, or stylistically inconsistent images, and ultimately forms a stable, high-quality aesthetic output capability.

Application Scenarios: Empowering the Creative Industry and Individual Creation

Concept Design and Advertising: In the fields of advertising and marketing, quickly generating high-quality concept art and visual materials is crucial. FLUX.1-Krea [dev] can rapidly generate images in various styles and compositions based on simple text descriptions, providing creative teams with a rich source of inspiration.

Generating Realistic Scenes, Characters, and Props: In game development, creating realistic scenes, characters, and props is a time-consuming and labor-intensive task. FLUX.1-Krea [dev] can serve as a powerful assistant for game artists, rapidly generating scene concept art, character design drafts, and prop model textures in various styles.

Special Effects Production and Preview Design: In film and television special effects production, FLUX.1-Krea [dev] can be used to generate special effects previews (Pre-vis), helping directors and special effects artists gain a clear understanding of the final visual effects before shooting. It can be used to generate some simple special effects elements, such as smoke, flames, magical light effects, etc., as materials for post-production compositing.

Providing High-Quality Materials for Designers: For UI/UX designers, graphic designers, etc., FLUX.1-Krea [dev] is also a very practical tool. They can use this model to quickly generate design elements such as icons, illustrations, background textures, etc., as references or direct materials for their own designs.

Future Outlook and Potential Impact

The release of FLUX.1-Krea [dev] is an important advancement in AI image generation technology and has a profound impact on the entire creative industry. It marks that AI image generation is moving from the stage of pursuing "likeness" to a new stage of pursuing "beauty" and "realism."