---
title: FLUX.2-kelin-4B-modular
canonical_url: "https://www.modelscope.cn/models/hf-diffusers/FLUX.2-kelin-4B-modular"
md_url: "https://www.modelscope.cn/models/hf-diffusers/FLUX.2-kelin-4B-modular.md"
repository: hf-diffusers/FLUX.2-kelin-4B-modular
last_updated: 2026-02-04
library_name:
  - pytorch
frameworks:
  - pytorch
downloads: 29
stars: 0
---

# FLUX.2-kelin-4B-modular

> FLUX.2-kelin-4B-modular - hf-diffusers 在 ModelScope 开源的模型。Flux2 Klein 4b Modular repo

- **Repository**: hf-diffusers/FLUX.2-kelin-4B-modular
- **Downloads**: 29
- **Stars**: 0
- **Last updated**: 2026-02-04

Source: https://www.modelscope.cn/models/hf-diffusers/FLUX.2-kelin-4B-modular

---

# Flux2 Klein 4b Modular repo

This contains mellon config for A single-node Mellon block for the FLUX.2-klein-4B pipeline. 


## How to create a modular repo like this one?

load the pipeline and save it to a new Hub repository:
```python
from diffusers import ModularPipeline

pipe = ModularPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-4B")
pipe.save_pretrained(
    "local/dir",
    repo_id="your-username/flux2-klein-auto-blocks",
    push_to_hub=True
)
```

## Generate the Mellon Config

Create and push the Mellon configuration with your desired UI types:
```python
from diffusers.modular_pipelines.mellon_node_utils import MellonPipelineConfig

mellon_config = MellonPipelineConfig.from_custom_block(
    pipe.blocks,
    input_types={
        "prompt": "textbox",
        "image": "image",
        "num_inference_steps": "number",
    },
    output_types={
        "images": "image"
    }
)

mellon_config.save(
    "local/dir",
    repo_id="your-username/flux2-klein-auto-blocks",
    push_to_hub=True
)
```

## Review and Adjust

The generated `mellon_pipeline_config.json` may need adjustments. You can:

- Remove inputs you don't want exposed in the UI
- Add slider ranges for numeric inputs
- Add dropdown options for string inputs
- update default value for numeric inputs


## Use in Mellon

1. Drag a **Dynamic Block Node** from the ModularDiffusers section
2. Enter `diffusers/FLUX.2-klein-4B-modular` and click "LOAD CUSTOM BLOCK" 
3. The node will show your configured inputs (prompt, image, num_inference_steps) and outputs (images)

## Supported Mellon Types

| Type | Input/Output | Description |
|------|--------------|-------------|
| `image` | Both | Image (PIL Image) |
| `textbox` | Input | Text input |
| `number` | Input | Numeric input |
| `slider` | Input | Slider for numeric values |
| `dropdown` | Input | Dropdown selection |
| `checkbox` | Input | Boolean toggle |
| `text` | Both | Text display |
