Views
No views yet
| GPU | VRAM | Mode | Notes |
|---|---|---|---|
| H200 | 141GB | Full GPU | Recommended |
| H100 | 80GB | Full GPU | Good |
| A100 | 80GB | CPU offload | Minimum |
1# Install huggingface_hub CLI
2pip install huggingface_hub
3
4# Login
5huggingface-cli login
6
7# Create repository
8huggingface-cli repo create flux2-dev-handler --type model1cd huggingface-endpoint/flux2-dev-handler
2
3# Clone the repo
4git clone https://huggingface.co/YOUR_USERNAME/flux2-dev-handler
5cd flux2-dev-handler
6
7# Copy handler files
8cp ../handler.py .
9cp ../requirements.txt .
10
11# Commit and push
12git add .
13git commit -m "Add FLUX.2-dev handler with remote text encoding"
14git pushYOUR_USERNAME/flux2-dev-handlernvidia-h200-141gb (recommended) or nvidia-h100-80gbHF_TOKEN: Your HuggingFace token (REQUIRED - for model access AND remote text encoding)NUM_INFERENCE_STEPS: 50 (optional, default is 50)1# Health check (via HuggingFace API)
2curl "https://YOUR_ENDPOINT_URL" \
3 -H "Authorization: Bearer YOUR_HF_TOKEN" \
4 -H "Content-Type: application/json" \
5 -d '{
6 "inputs": "test",
7 "parameters": {"mode": "generate", "num_inference_steps": 2, "width": 512, "height": 512}
8 }'1{
2 "inputs": "A beautiful sunset over mountains, photorealistic, 16:9",
3 "parameters": {
4 "mode": "generate",
5 "width": 1920,
6 "height": 1080,
7 "num_inference_steps": 50,
8 "guidance_scale": 4.0,
9 "seed": -1
10 }
11}1{
2 "image": "data:image/png;base64,...",
3 "generation_time_seconds": 12.5
4}1{
2 "inputs": "the person from image 1 standing in a park, sunset lighting",
3 "parameters": {
4 "mode": "generate_with_refs",
5 "reference_images": [
6 "data:image/png;base64,..."
7 ],
8 "width": 1920,
9 "height": 1080,
10 "num_inference_steps": 50,
11 "guidance_scale": 2.5,
12 "seed": -1
13 }
14}1{
2 "image": "data:image/png;base64,...",
3 "generation_time_seconds": 15.2,
4 "reference_count": 1
5}| Variable | Default | Description |
|---|---|---|
HF_TOKEN | - | HuggingFace token (REQUIRED for model access and remote text encoding) |
NUM_INFERENCE_STEPS | 50 | Default inference steps |
transformers>=4.47.0 to requirements.txt.remote-text-encoder-flux-2.huggingface.co