Safety Warning & Terms of Access

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

This model has safety filtering removed and can generate General NSFW content. By accessing this model, you agree to: (1) Use it responsibly and legally, (2) Not use it to create illegal content, (3) Comply with all applicable laws in your country.

Log in or Sign Up to review the conditions and access this model content.

FLUX.2-klein-4B Uncensored Text Encoder

ko-fiใ€€ Tips are greatly appreciated and help sustain the compute resources needed for further research!

Read this in other languages: ๆ—ฅๆœฌ่ชž (Japanese)

Overview

This repository provides an "uncensored" text encoder for the FLUX.2-klein-4B image generation model by Black Forest Labs. It bypasses the built-in safety filters to unlock the model's unconstrained generative capabilities.

By removing the restrictive blocks at the prompt input stage, this encoder allows the model to fully utilize its underlying representational power. The model is provided in the standard Hugging Face Safetensors format, alongside several quantized GGUF formats for resource-efficient inference.


Concept & Mechanism

This model does not rely on fine-tuning with additional image datasets. Instead, it employs a surgical, purely mathematical approach known as Abliteration (Orthogonalization of Concept Vectors) to modify the model weights directly.

Mathematical Removal of the Refusal Vector

We neutralized the safety filter within the LLM-based text encoder (Qwen3 architecture, 36 layers) embedded in FLUX.2-klein-4B through the following steps:

  1. Prompt Contrast: We fed the model pairs of "harmful/extreme" prompts and "harmless/general" prompts to compare their internal activation states.
  2. Layer-by-Layer Refusal Vector Extraction: Through rigorous L2 norm spike analysis, we discovered that the model dramatically amplifies its refusal logic in the final layers (specifically spiking around layers 32-34) to forcefully override alignments. Therefore, we dynamically extracted the refusal direction for each individual layer from Layer 14 all the way to Layer 35 (22 layers total).
  3. Sequential Weight Orthogonalization: For each of the 22 target layers, we mathematically subtracted the projection component of its specific refusal vector from its Attention output layer (o_proj) and MLP down-projection layer (down_proj).

This sequential, layer-by-layer orthogonalization flawlessly severs the model's ability to output inferences in the "refusal" direction without lobotomizing its general capabilities. As a result, the text encoder no longer rejects extreme inputs; instead, it passes them directly to the DiT (the core rendering engine) as valid drawing instructions.


Mathematical Proof of Unrestricted Output

Without even running the computationally heavy image generation (DiT) process, we can mathematically prove that the output restriction has been removed by comparing the Cosine Similarity of the output vectors (embeddings).

Similarity=Aโ‹…BโˆฅAโˆฅโˆฅBโˆฅSimilarity = \frac{\mathbf{A} \cdot \mathbf{B}}{\|\mathbf{A}\| \|\mathbf{B}\|} (Where $\mathbf{A}$ is the output vector of the official model, and $\mathbf{B}$ is the output vector of this abliterated model.)

Verification Results (Layer 35: Base vs Uncensored GGUF Q8_0)

  • Cosine Similarity for Harmless Prompts: 0.9791
    • (Analysis) Because the refusal vector is not triggered by safe prompts, the outputs of both models remain nearly identical. This proves that the fundamental performance and capabilities of the model have not been degraded.
  • Cosine Similarity for Extreme Prompts: 0.9607
    • (Analysis) For extreme prompts, the official model distorts the output via its safety filter. The abliterated model successfully ignores this refusal vector, resulting in a divergence between the two outputs in the final layer. This serves as mathematical proof that the safety filter has been successfully neutralized across the 22 layers.

Repository Structure

This repository contains the full suite of files necessary for the text encoder to function correctly. Both Safetensors and GGUF formats are available in the same repository to suit your memory constraints and workflow.

  • flux2-klein-4b-uncensored-text-encoder/: The standard uncensored text encoder (Safetensors) with the refusal vectors mathematically removed.
  • flux2-klein-4b-uncensored-f16.gguf (approx. 8.05 GB): FP16 version for high-precision local inference.
  • flux2-klein-4b-uncensored-q8_0.gguf (approx. 4.28 GB): 8-bit quantized version.
  • flux2-klein-4b-uncensored-q6_k.gguf (approx. 3.30 GB): 6-bit quantized version.
  • flux2-klein-4b-uncensored-q4_k_m.gguf (approx. 2.49 GB): 4-bit quantized version.

Usage

Using with ComfyUI

Download the necessary format (flux2-klein-4b-uncensored-text-encoder folder or one of the .gguf files) from this repository and place it into your ComfyUI models/clip directory. You can then load it using standard nodes or GGUF-compatible nodes (like DualCLIPLoader) and pair it with the official FLUX.2-klein-4B DiT to generate images.

For Developers & Researchers (Python / Diffusers)

When using Python scripts with the transformers or diffusers library, simply replace the default text encoder with this model. You can load either the safetensors or the GGUF version (requires gguf>=0.10.0).

from transformers import AutoTokenizer, AutoModel

# Load the text encoder by specifying the path to this model
tokenizer = AutoTokenizer.from_pretrained("ponpoke/flux2-klein-4b-uncensored-text-encoder")
text_encoder = AutoModel.from_pretrained("ponpoke/flux2-klein-4b-uncensored-text-encoder")

# Proceed to use it within your standard FLUX.2 pipeline

Important Note: Absence of DiT Guardrails and the Knowledge Gap

By completing Phase 1, this text encoder will pass all promptsโ€”including highly extreme or NSFW contentโ€”directly to the DiT without rejection.

In our subsequent verification, we mathematically proved (via L2 norm spike analysis) that FLUX.2's DiT does not contain any built-in guardrails (refusal circuits) designed to intentionally destroy or block images. Therefore, whether an image is successfully rendered depends entirely on whether the DiT possesses the visual "knowledge" of that concept.

  • If the DiT knows the concept (e.g., Gore/Violence): Concepts that were learned by the DiT but previously blocked by the text encoder will now render perfectly just by using this Phase 1 text encoder. No further action is required.
  • If the DiT lacks the concept (e.g., NSFW/Extreme Dismemberment): Even though the text encoder passes the instruction, the DiT itself does not know how to draw it because those concepts were completely scrubbed from the training dataset (a knowledge gap). The output will likely collapse or result in noise.

Conclusion: If you wish to generate specific NSFW elements that the DiT lacks the capacity to draw, attempting to "abliterate" or mathematically cut weights from the DiT is useless. You must apply a separate NSFW LoRA (or DoRA) to directly teach those missing concepts to the DiT. This text encoder functions as an unbreakable foundation, ensuring that your LoRA's instructions reach the DiT without interference.


Disclaimer

  • This model is published strictly for research and technical verification purposes (specifically, to validate the effectiveness of Abliteration).
  • The creator assumes no responsibility for any damages, issues, or inappropriate content generated through the use of this model.
  • Please adhere to all applicable terms of service (such as the Black Forest Labs license, e.g., BFL Non-Commercial) and use the model responsibly and ethically.





ๆ—ฅๆœฌ่ชž (Japanese)

ๆฆ‚่ฆ (Overview)

ใ“ใฎใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆใฏใ€Black Forest Labsใซใ‚ˆใ‚‹็”ปๅƒ็”ŸๆˆAIใƒขใƒ‡ใƒซใ€ŒFLUX.2-klein-4Bใ€ใฎใ‚ปใƒผใƒ•ใƒ†ใ‚ฃใƒ•ใ‚ฃใƒซใ‚ฟใƒผ๏ผˆๅ‡บๅŠ›ๅˆถ้™๏ผ‰ใ‚’่งฃ้™คใ—ใ€ใƒขใƒ‡ใƒซๆœฌๆฅใฎ่‡ช็”ฑใชๆ็”ป่ƒฝๅŠ›ใ‚’ๅผ•ใๅ‡บใ™ใŸใ‚ใฎใ€ŒUncensored๏ผˆใ‚ขใƒณใ‚ปใƒณใ‚ตใƒผใƒ‰๏ผ‰็‰ˆใ€ไฝœๆˆใƒ—ใƒญใ‚ปใ‚นใงใ™ใ€‚

ๆœฌใƒชใƒใ‚ธใƒˆใƒชใฏใ€ใƒชใ‚ฝใƒผใ‚นๅŠน็އใ‚’ๆœ€ๅคงๅŒ–ใ™ใ‚‹ๆฎต้šŽ็š„ใ‚ขใƒ—ใƒญใƒผใƒใฎใƒ†ใ‚ญใ‚นใƒˆใ‚จใƒณใ‚ณใƒผใƒ€ใƒผใฎๅฎŒๅ…จ่งฃ๏ผ‰ใฎๆˆๆžœ็‰ฉใจไฝœๆฅญๆ‰‹้ †ใ‚’่จ˜้Œฒใ—ใŸใ‚‚ใฎใงใ™ใ€‚

ใƒ•ใ‚งใƒผใ‚บ1๏ผšAbliteration๏ผˆๆ‹’็ตถใƒ™ใ‚ฏใƒˆใƒซใฎๆ•ฐๅญฆ็š„้™คๅŽป๏ผ‰

FLUX.2-klein-4Bใซๅ†…ๅŒ…ใ•ใ‚Œใฆใ„ใ‚‹LLMใƒ™ใƒผใ‚นใฎใƒ†ใ‚ญใ‚นใƒˆใ‚จใƒณใ‚ณใƒผใƒ€ใƒผ๏ผˆQwen3ใ‚ขใƒผใ‚ญใƒ†ใ‚ฏใƒใƒฃใƒป36ๅฑค๏ผ‰ใซๅฏพใ—ใ€ใ€ŒAbliteration๏ผˆ็›ดไบคๅŒ–ใซใ‚ˆใ‚‹ๆฆ‚ๅฟต้™คๅŽป๏ผ‰ใ€ใจใ„ใ†ๆ‰‹ๆณ•ใ‚’็”จใ„ใฆๅฎ‰ๅ…จ่ฃ…็ฝฎใ‚’็„กๅŠนๅŒ–ใ—ใพใ—ใŸใ€‚

ๅฎŸ่กŒใ—ใŸๆ‰‹ๆณ•ใฎไป•็ต„ใฟ

ๆ–ฐใŸใช็”ปๅƒใ‚ปใƒƒใƒˆใ‚’ไฝฟใฃใŸ่ฟฝๅŠ ๅญฆ็ฟ’๏ผˆFine-Tuning๏ผ‰ใฏไธ€ๅˆ‡่กŒใฃใฆใ„ใพใ›ใ‚“ใ€‚ใใฎไปฃใ‚ใ‚Šใ€ใƒขใƒ‡ใƒซใฎ้‡ใฟ๏ผˆWeights๏ผ‰ใ‚’็›ดๆŽฅๆ•ฐๅญฆ็š„ใซๆ›ธใๆ›ใˆใ‚‹ๅค–็ง‘็š„ใ‚ขใƒ—ใƒญใƒผใƒใ‚’ๆŽก็”จใ—ใฆใ„ใพใ™ใ€‚

  1. ใƒ—ใƒญใƒณใƒ—ใƒˆใฎๅฏพๆฏ”: ใƒขใƒ‡ใƒซใซใ€Œใ‚ปใƒผใƒ•ใƒ†ใ‚ฃใซๅผ•ใฃใ‹ใ‹ใ‚‹้Žๆฟ€ใชใƒ—ใƒญใƒณใƒ—ใƒˆใ€ใจใ€Œ็„กๅฎณใชไธ€่ˆฌ็š„ใชใƒ—ใƒญใƒณใƒ—ใƒˆใ€ใฎไธกๆ–นใ‚’ๅ…ฅๅŠ›ใ—ใพใ™ใ€‚
  2. ๆ‹’็ตถใƒ™ใ‚ฏใƒˆใƒซใฎๆŠฝๅ‡บ (Extraction): L2ใƒŽใƒซใƒ ใƒปใ‚นใƒ‘ใ‚คใ‚ฏ่งฃๆžใ‚’ๅฎŸๆ–ฝใ—ใŸ็ตๆžœใ€็ต‚ๆœŸๅฑค๏ผˆLayer 32ใ€œ34ไป˜่ฟ‘๏ผ‰ใงใƒขใƒ‡ใƒซใŒใ€Œๅ‡บๅŠ›ใฎๅ†่ฃœๆญฃใ€ใ‚’ๅผทๅˆถ็š„ใซ่กŒใ†ๅผทๅŠ›ใชๆ‹’็ตถใ‚นใƒ‘ใ‚คใ‚ฏใŒๅญ˜ๅœจใ™ใ‚‹ใ“ใจใŒๅˆคๆ˜Žใ—ใพใ—ใŸใ€‚ใ“ใ‚Œใ‚’ๆ น็ตถใ™ใ‚‹ใŸใ‚ใ€ๅฏพ่ฑกใ‚’ใ€ŒLayer 14ใ€œ35ใ€ใฎๅˆ่จˆ22ๅฑคใซๆ‹กๅผตใ—ใ€ๅ„ๅฑคๅฐ‚็”จใฎๆ‹’็ตถใƒ™ใ‚ฏใƒˆใƒซ๏ผˆRefusal Direction๏ผ‰ใ‚’ๅ‹•็š„ใซ็‰นๅฎšใƒปๆญฃ่ฆๅŒ–ใ—ใพใ—ใŸใ€‚
  3. ้‡ใฟใฎ็›ดไบคๅŒ– (Orthogonalization): ๆŠฝๅ‡บใ—ใŸๅ„ๅฑคใฎๆ‹’็ตถใƒ™ใ‚ฏใƒˆใƒซใ‚’็”จใ„ใ€ใƒ†ใ‚ญใ‚นใƒˆใ‚จใƒณใ‚ณใƒผใƒ€ใƒผๅ†…ใฎใ™ในใฆใฎAttentionๅ‡บๅŠ›ๅฑค๏ผˆo_proj๏ผ‰ใจMLPใƒ€ใ‚ฆใƒณๅฐ„ๅฝฑๅฑค๏ผˆdown_proj๏ผ‰ใฎ้‡ใฟ่กŒๅˆ—ใ‚’็›ดไบคๅŒ–๏ผˆOrthogonalize๏ผ‰ใ—ใพใ—ใŸใ€‚ๅ…ทไฝ“็š„ใซใฏใ€้‡ใฟ่กŒๅˆ—ใ‹ใ‚‰ใ€Œๆ‹’็ตถใƒ™ใ‚ฏใƒˆใƒซๆ–นๅ‘ใธใฎๅฐ„ๅฝฑๆˆๅˆ†ใ€ใ‚’ๅผ•ใ็ฎ—ใ™ใ‚‹ใ“ใจใงใ€ใƒขใƒ‡ใƒซใŒใ“ใฎๆ–นๅ‘๏ผˆๅ‡บๅŠ›ๆ‹’็ตถ๏ผ‰ใซๆŽจ่ซ–ใ‚’ๅ‡บๅŠ›ใงใใชใ„ใ‚ˆใ†็‰ฉ็†็š„ใซๆ–ญใกๅˆ‡ใฃใฆใ„ใพใ™ใ€‚

็ตๆžœใจใ—ใฆใ€ใƒ†ใ‚ญใ‚นใƒˆใ‚จใƒณใ‚ณใƒผใƒ€ใƒผๅดใฎใ‚ปใƒผใƒ•ใƒ†ใ‚ฃๆฉŸ่ƒฝใŒๆ•ฐๅญฆ็š„ใซๅฎŒๅ…จใซๅ‰Š้™คใ•ใ‚Œใพใ—ใŸใ€‚ใ“ใ‚Œใซใ‚ˆใ‚Šใ€ใฉใฎใ‚ˆใ†ใช้Žๆฟ€ใชๅ…ฅๅŠ›ใงใ‚ใฃใฆใ‚‚ใ€ใƒ†ใ‚ญใ‚นใƒˆใ‚จใƒณใ‚ณใƒผใƒ€ใƒผใฏใใ‚Œใ‚’ๆ‹’็ตถใ›ใšใ€ๆ็”ปๆŒ‡็คบใจใ—ใฆDiT๏ผˆๆ็”ปใ‚จใƒณใ‚ธใƒณๆœฌไฝ“๏ผ‰ใธใใฎใพใพใƒ‘ใ‚นใ™ใ‚‹ใ‚ˆใ†ใซใชใ‚Šใพใ™ใ€‚


ๆˆๆžœ็‰ฉใƒ•ใ‚กใ‚คใƒซ

ๆœฌใƒชใƒใ‚ธใƒˆใƒชใซใฏใ€ใƒ†ใ‚ญใ‚นใƒˆใ‚จใƒณใ‚ณใƒผใƒ€ใƒผใ‚’ๅ‹•ไฝœใ•ใ›ใ‚‹ใŸใ‚ใซๅฟ…่ฆใชใ™ในใฆใฎใƒ•ใ‚กใ‚คใƒซใŒๅซใพใ‚Œใฆใ„ใพใ™ใ€‚ใ”่‡ช่บซใฎใƒกใƒขใƒช็’ฐๅขƒใซๅˆใ‚ใ›ใฆใ€SafetensorsๅฝขๅผใพใŸใฏGGUFๅฝขๅผใ‚’้ธๆŠžใ—ใฆไฝฟ็”จใงใใพใ™ใ€‚

  • flux2-klein-4b-uncensored-text-encoder/: Abliterationๅ‡ฆ็†ใŒๅฎŒไบ†ใ—ใ€ใ‚ปใƒผใƒ•ใƒ†ใ‚ฃใƒ•ใ‚ฃใƒซใ‚ฟใƒผใŒๅ–ใ‚Š้™คใ‹ใ‚ŒใŸๆจ™ๆบ–ใฎใƒ†ใ‚ญใ‚นใƒˆใ‚จใƒณใ‚ณใƒผใƒ€ใƒผ๏ผˆSafetensorsๅฝขๅผ๏ผ‰ใ€‚
  • flux2-klein-4b-uncensored-f16.gguf (็ด„ 8.05 GB): ้ซ˜็ฒพๅบฆใชๆŽจ่ซ–ใฎใŸใ‚ใฎFP16 GGUFใƒขใƒ‡ใƒซใ€‚
  • flux2-klein-4b-uncensored-q8_0.gguf (็ด„ 4.28 GB): 8-bit้‡ๅญๅŒ–ใƒขใƒ‡ใƒซใ€‚
  • flux2-klein-4b-uncensored-q6_k.gguf (็ด„ 3.30 GB): 6-bit้‡ๅญๅŒ–ใƒขใƒ‡ใƒซใ€‚
  • flux2-klein-4b-uncensored-q4_k_m.gguf (็ด„ 2.49 GB): 4-bit้‡ๅญๅŒ–ใƒขใƒ‡ใƒซใ€‚

ๆ•ฐๅญฆ็š„ใ‚ขใƒ—ใƒญใƒผใƒใซใ‚ˆใ‚‹ใ‚ขใƒณใ‚ปใƒณใ‚ตใƒผใƒ‰ๅŒ–ใฎ่จผๆ˜Ž

็”ปๅƒ็”Ÿๆˆ๏ผˆDiT๏ผ‰ใจใ„ใ†้‡ใ„ๅ‡ฆ็†ใ‚’ๅ›žใ™ใพใงใ‚‚ใชใใ€ใƒ†ใ‚ญใ‚นใƒˆใ‚จใƒณใ‚ณใƒผใƒ€ใƒผใฎๆฎต้šŽใงใ€Œๅ‡บๅŠ›ๅˆถ้™ใŒๆ•ฐๅญฆ็š„ใซ่งฃ้™คใ•ใ‚Œใฆใ„ใ‚‹ใ“ใจใ€ใ‚’่จผๆ˜Žใ™ใ‚‹ใŸใ‚ใ€ๅ‡บๅŠ›ใƒ™ใ‚ฏใƒˆใƒซ๏ผˆๅŸ‹ใ‚่พผใฟ่กจ็พ๏ผ‰ใฎใ‚ณใ‚ตใ‚คใƒณ้กžไผผๅบฆ๏ผˆCosine Similarity๏ผ‰ใ‚’ๆฏ”่ผƒใ—ใพใ—ใŸใ€‚

Similarity=Aโ‹…BโˆฅAโˆฅโˆฅBโˆฅSimilarity = \frac{\mathbf{A} \cdot \mathbf{B}}{\|\mathbf{A}\| \|\mathbf{B}\|} (ใ“ใ“ใงใ€$\mathbf{A}$ ใฏๅ…ฌๅผใƒขใƒ‡ใƒซใฎๅ‡บๅŠ›ใƒ™ใ‚ฏใƒˆใƒซใ€$\mathbf{B}$ ใฏๆœฌใƒขใƒ‡ใƒซใฎๅ‡บๅŠ›ใƒ™ใ‚ฏใƒˆใƒซใ‚’ๆŒ‡ใ—ใพใ™ใ€‚)

ๆคœ่จผ็ตๆžœ๏ผˆLayer 35: Base vs Uncensored GGUF Q8_0๏ผ‰

  • ๅฎ‰ๅ…จใชใƒ—ใƒญใƒณใƒ—ใƒˆใฎ้กžไผผๅบฆ (Harmless): 0.9791
    • (่€ƒๅฏŸ) ๅฎ‰ๅ…จใชใƒ—ใƒญใƒณใƒ—ใƒˆใงใฏๆ‹’็ตถใƒ™ใ‚ฏใƒˆใƒซใŒ็™บๅ‹•ใ—ใชใ„ใŸใ‚ใ€ไธก่€…ใฎๅ‡บๅŠ›ใฏ้žๅธธใซไผผ้€šใฃใŸใ‚‚ใฎ๏ผˆ้กžไผผๅบฆใŒ้ซ˜ใ„๏ผ‰ใซใชใ‚Šใพใ™ใ€‚ใ“ใ‚Œใฏ22ๅฑคใซๅŠใถๆ‰‹่ก“ใ‚’่กŒใฃใฆใ‚‚ใ€Œใƒขใƒ‡ใƒซใฎๅŸบๆœฌๆ€ง่ƒฝใŒ็ ดๅฃŠใ•ใ‚Œใฆใ„ใชใ„ใ€ใ“ใจใฎ่จผๆ˜Žใงใ™ใ€‚
  • ้Žๆฟ€ใชใƒ—ใƒญใƒณใƒ—ใƒˆใฎ้กžไผผๅบฆ (Harmful): 0.9607
    • (่€ƒๅฏŸ) ้Žๆฟ€ใชใƒ—ใƒญใƒณใƒ—ใƒˆใงใฏใ€ๅ…ƒใฎใƒขใƒ‡ใƒซใŒใ‚ปใƒผใƒ•ใƒ†ใ‚ฃใƒ•ใ‚ฃใƒซใ‚ฟใƒผ๏ผˆๆ‹’็ตถๆ–นๅ‘๏ผ‰ใธๅ‡บๅŠ›ใ‚’ๆญชใ‚ใพใ™ใŒใ€ใ‚ขใƒณใ‚ปใƒณใ‚ตใƒผใƒ‰ๅŒ–ใƒขใƒ‡ใƒซใฏใใฎใƒ™ใ‚ฏใƒˆใƒซใ‚’็„ก่ฆ–ใ™ใ‚‹ใŸใ‚ใ€ไธก่€…ใฎๅ‡บๅŠ›ใŒๆœ€็ต‚ๅฑคใงๆ˜Ž็ขบใซไน–้›ขใ—ใพใ™ใ€‚ใ“ใ‚ŒใŒใ€Œๅˆถ้™ใŒๆ•ฐๅญฆ็š„ใซ่งฃ้™คใ•ใ‚Œใฆใ„ใ‚‹ใ€ใ“ใจใฎ่จผๆ˜Žใซใชใ‚Šใพใ™ใ€‚

ไฝฟใ„ๆ–น (Usage)

ComfyUIใงใฎไฝฟ็”จ

ๆœฌใƒชใƒใ‚ธใƒˆใƒชใ‹ใ‚‰ๅฟ…่ฆใชๅฝขๅผใฎใƒ•ใ‚กใ‚คใƒซ๏ผˆflux2-klein-4b-uncensored-text-encoder ใƒ•ใ‚ฉใƒซใƒ€ใ€ใพใŸใฏๅ„ .gguf ใƒ•ใ‚กใ‚คใƒซ๏ผ‰ใ‚’ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ใ—ใ€ComfyUIใฎ models/clip ใƒ‡ใ‚ฃใƒฌใ‚ฏใƒˆใƒชใซ้…็ฝฎใ—ใฆใใ ใ•ใ„ใ€‚ใใฎๅพŒใ€ใ€ŒDualCLIPLoaderใ€็ญ‰ใฎๆจ™ๆบ–ใƒŽใƒผใƒ‰ใ‚„GGUFๅฏพๅฟœใƒŽใƒผใƒ‰ใง่ชญใฟ่พผใพใ›ใ€ๅ…ฌๅผใฎ FLUX.2-klein-4B DiT ใจ็ต„ใฟๅˆใ‚ใ›ใฆ็”ปๅƒ็”Ÿๆˆใ‚’่กŒใ†ใ“ใจใŒใงใใพใ™ใ€‚

้–‹็™บ่€…ใƒป็ ”็ฉถ่€…ๅ‘ใ‘ (Python / Diffusers)

Pythonใ‚นใ‚ฏใƒชใƒ—ใƒˆ๏ผˆtransformers ใ‚„ diffusers ใƒฉใ‚คใƒ–ใƒฉใƒช๏ผ‰ใ‹ใ‚‰ไฝฟ็”จใ™ใ‚‹ๅ ดๅˆใฏใ€ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใฎใƒ†ใ‚ญใ‚นใƒˆใ‚จใƒณใ‚ณใƒผใƒ€ใƒผใ‚’ๆœฌใƒขใƒ‡ใƒซใซๅทฎใ—ๆ›ฟใˆใฆใใ ใ•ใ„ใ€‚Safetensors็‰ˆใงใ‚‚GGUF็‰ˆใงใ‚‚ใƒญใƒผใƒ‰ๅฏ่ƒฝใงใ™๏ผˆGGUF็‰ˆใฏ gguf>=0.10.0 ใŒๅฟ…่ฆใงใ™๏ผ‰ใ€‚

from transformers import AutoTokenizer, AutoModel

# ๆœฌใƒขใƒ‡ใƒซใฎใƒ‘ใ‚นใ‚’ๆŒ‡ๅฎšใ—ใฆใƒ†ใ‚ญใ‚นใƒˆใ‚จใƒณใ‚ณใƒผใƒ€ใƒผใ‚’ใƒญใƒผใƒ‰
tokenizer = AutoTokenizer.from_pretrained("ponpoke/flux2-klein-4b-uncensored-text-encoder")
text_encoder = AutoModel.from_pretrained("ponpoke/flux2-klein-4b-uncensored-text-encoder")

# ไปฅ้™ใฏ้€šๅธธใฎFLUX.2ใƒ‘ใ‚คใƒ—ใƒฉใ‚คใƒณใซ็ต„ใฟ่พผใ‚“ใงไฝฟ็”จ

้‡่ฆใชๆณจๆ„็‚น๏ผšDiTๅดใฎใ€Œใ‚ฌใƒผใƒ‰ใƒฌใƒผใƒซใฎไธๅœจใ€ใจใ€Œ็Ÿฅ่ญ˜ใฎๆฌ ่ฝใ€ใซใคใ„ใฆ

ๆœฌใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆใซใ‚ˆใฃใฆใ€ใƒ†ใ‚ญใ‚นใƒˆใ‚จใƒณใ‚ณใƒผใƒ€ใƒผใฏใ‚ใ‚‰ใ‚†ใ‚‹้Žๆฟ€ใชใƒ—ใƒญใƒณใƒ—ใƒˆ๏ผˆNSFWใ‚’ๅซใ‚€๏ผ‰ใ‚’ๆ‹’็ตถใ™ใ‚‹ใ“ใจใชใใ€ใใฎใพใพๆ็”ปๆŒ‡็คบใจใ—ใฆDiT๏ผˆๆ็”ปใ‚จใƒณใ‚ธใƒณๆœฌไฝ“๏ผ‰ใธใƒ‘ใ‚นใ™ใ‚‹ใ‚ˆใ†ใซใชใ‚Šใพใ—ใŸใ€‚

ใใฎๅพŒใฎ**ๆคœ่จผ**ใซใŠใ„ใฆใ€FLUX.2ใฎDiTใซใฏใ€Œ็”ปๅƒใ‚’ๆ„ๅ›ณ็š„ใซๅฃŠใ™ใ‚ˆใ†ใชใ‚ฌใƒผใƒ‰ใƒฌใƒผใƒซ๏ผˆๆ‹’็ตถๅ›ž่ทฏ๏ผ‰ใ€ใฏๆœ€ๅˆใ‹ใ‚‰ๅญ˜ๅœจใ—ใชใ„ใ“ใจใŒๆ•ฐๅญฆ็š„ใซ่จผๆ˜Žใ•ใ‚Œใพใ—ใŸใ€‚ๅฎŸ้š›ใซใใฎ็”ปๅƒใŒๆ็”ปใ•ใ‚Œใ‚‹ใ‹ใฉใ†ใ‹ใฏใ€ๆœ€็ต‚็š„ใซDiTใŒใ€Œใใฎ่ฆ–่ฆš็š„ๆฆ‚ๅฟต๏ผˆๆใๆ–น๏ผ‰ใ‚’็Ÿฅใฃใฆใ„ใ‚‹ใ‹ใ€ใซๅฎŒๅ…จใซไพๅญ˜ใ—ใพใ™ใ€‚

  • DiTใŒๆฆ‚ๅฟตใ‚’็Ÿฅใฃใฆใ„ใ‚‹ๅ ดๅˆ๏ผˆไพ‹๏ผšๆต่ก€ใƒปๆšดๅŠ›่กจ็พ๏ผ‰: ๅ…ƒใ€…DiTใซๅญฆ็ฟ’ใ•ใ‚Œใฆใ„ใŸใŒใƒ†ใ‚ญใ‚นใƒˆใ‚จใƒณใ‚ณใƒผใƒ€ใƒผๅดใงใƒ•ใ‚ฟใ‚’ใ•ใ‚Œใฆใ„ใŸใ‚‚ใฎใฏใ€ๆœฌใƒขใƒ‡ใƒซ๏ผˆใƒ•ใ‚งใƒผใ‚บ1ใฎใ‚ขใƒณใ‚ปใƒณใ‚ตใƒผใƒ‰ๅŒ–๏ผ‰ใ‚’ไฝฟ็”จใ™ใ‚‹ใ ใ‘ใงๆ„ๅ›ณ้€šใ‚Šใซๆ็”ปใ•ใ‚Œใ‚‹ใ‚ˆใ†ใซใชใ‚Šใพใ™ใ€‚่ฟฝๅŠ ใฎๅฏพ็ญ–ใฏไธ่ฆใงใ™ใ€‚
  • DiTใŒๆฆ‚ๅฟตใ‚’็Ÿฅใ‚‰ใชใ„ๅ ดๅˆ๏ผˆไพ‹๏ผšๆ€ง็š„่กจ็พใƒปไบบไฝ“ๆฌ ๆ๏ผ‰: ใƒ†ใ‚ญใ‚นใƒˆใ‚จใƒณใ‚ณใƒผใƒ€ใƒผใŒๆŒ‡็คบใ‚’้€šใ—ใฆใ‚‚ใ€DiT่‡ชไฝ“ใŒใใฎ่กจ็พๆ–นๆณ•ใ‚’็Ÿฅใ‚‰ใชใ„๏ผˆใƒ‡ใƒผใ‚ฟใ‚ปใƒƒใƒˆใ‹ใ‚‰ๅพนๅบ•็š„ใซๆผ‚็™ฝใ•ใ‚Œใฆใ„ใ‚‹๏ผ‰ๅ ดๅˆใ€็”ปๅƒใŒ็ ด็ถปใ™ใ‚‹ใ‹ใ€ใƒŽใ‚คใ‚บใŒๅ‡บๅŠ›ใ•ใ‚Œใพใ™ใ€‚

ใ€็ต่ซ–ใ€‘ DiTใŒๆ็”ป่ƒฝๅŠ›ใ‚’ๆŒใฃใฆใ„ใชใ„็‰นๅฎšใฎNSFW่ฆ็ด ใชใฉใ‚’ๅ‡บๅŠ›ใ•ใ›ใŸใ„ๅ ดๅˆใฏใ€ใƒขใƒ‡ใƒซใ‹ใ‚‰ไฝ•ใ‹ใ‚’ๅ‰Šใ‚‹ใฎใงใฏใชใใ€ใ€ŒDiTๅดใซใใฎๆฆ‚ๅฟตใ‚’็›ดๆŽฅๆ•™ใˆ่พผใ‚€NSFW LoRA็ญ‰ใฎ่ฟฝๅŠ ๅญฆ็ฟ’ใƒ‡ใƒผใ‚ฟใ€ใ‚’ๅˆฅ้€”็”จๆ„ใ—ใ€้ฉ็”จใ™ใ‚‹ๅฟ…่ฆใŒใ‚ใ‚Šใพใ™ใ€‚ๆœฌใƒขใƒ‡ใƒซใฏใ€ใƒ†ใ‚ญใ‚นใƒˆใ‚จใƒณใ‚ณใƒผใƒ€ใƒผๅดใฎใƒ–ใƒญใƒƒใ‚ฏใ‚’่งฃ้™คใ—ใ€ใใฎLoRAใฎๆŒ‡็คบใ‚’็ขบๅฎŸใซDiTใธๅฑŠใ‘ใ‚‹ใŸใ‚ใฎใ€Œๅผทๅ›บใชๅœŸๅฐใ€ใจใ—ใฆๆฉŸ่ƒฝใ—ใพใ™ใ€‚


ๅ…่ฒฌไบ‹้ … (Disclaimer)

  • ๆœฌใƒขใƒ‡ใƒซใฏ็ ”็ฉถใŠใ‚ˆใณๆŠ€่ก“ๆคœ่จผ๏ผˆAbliterationใฎๆœ‰ๅŠนๆ€ง็ขบ่ช๏ผ‰ใ‚’็›ฎ็š„ใจใ—ใฆๅ…ฌ้–‹ใ•ใ‚Œใฆใ„ใพใ™ใ€‚
  • ใƒขใƒ‡ใƒซใฎไฝฟ็”จใซใ‚ˆใฃใฆ็”Ÿใ˜ใŸใ‚ใ‚‰ใ‚†ใ‚‹ๆๅฎณใ€ใƒˆใƒฉใƒ–ใƒซใ€ใพใŸใฏไธ้ฉๅˆ‡ใชใ‚ณใƒณใƒ†ใƒณใƒ„ใฎ็”Ÿๆˆใซใคใ„ใฆใ€่ฃฝไฝœ่€…ใฏไธ€ๅˆ‡ใฎ่ฒฌไปปใ‚’่ฒ ใ„ใพใ›ใ‚“ใ€‚
  • ๅˆฉ็”จ่ฆ็ด„๏ผˆBlack Forest Labsใฎใƒฉใ‚คใ‚ปใƒณใ‚น็ญ‰๏ผ‰ใ‚’้ตๅฎˆใ—ใ€่‡ชๅทฑ่ฒฌไปปใ‹ใคๅ€ซ็†็š„ใช็ฏ„ๅ›ฒๅ†…ใงใ”ไฝฟ็”จใใ ใ•ใ„ใ€‚
Downloads last month
2,359
GGUF
Model size
4B params
Architecture
qwen3
Hardware compatibility
Log In to add your hardware

4-bit

6-bit

8-bit

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for ponpoke/flux2-klein-4b-uncensored-text-encoder

Quantized
(19)
this model