Flux.1 Dev OneReward
支援多種使用例,如圖像局部重繪、擴圖和物體移除,由位元組跳動研究團隊開發
關於
The 'Flux.1 Dev OneReward' workflow is a versatile tool designed for image manipulation tasks such as inpainting, outpainting, and object removal. Developed by the bytedance-research team, this workflow leverages the Flux.1 model to seamlessly fill in or extend parts of an image. The workflow employs a series of nodes, including LoadImage, SaveImage, and PreviewImage, to manage the input and output processes. The core functionality is driven by nodes like cb0eaf1c-704f-477d-8893-79665db14ed1 and b8560576-5524-4495-baa5-2cb40da12e9e, which handle the complex computations required for high-quality image editing.
This makes it particularly useful for creative professionals and enthusiasts who need precise control over image content.
您提供的內容
- 正在讀取工作流程
在 ComfyUI 中執行。 此工作流程無法在此頁面上執行。請在已載入所有內容的 Comfy Cloud 中開啟,或下載到您自己的 ComfyUI。
在 Cloud 中試用工作流程內部
節點圖的唯讀預覽。請在 Comfy Cloud 中開啟,或下載後編輯節點。
從程式碼使用此工作流程
可行時會根據工作流程圖和輸入內容產生;否則會顯示儲存的範例。執行可能產生費用的程式碼前,請檢查認證資訊和端點。
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
需要付費 Cloud 方案與點數。
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"17": {
"class_type": "LoadImage",
"inputs": {
"image": "image_flux.1_fill_dev_OneReward_input_image.png"
},
"_meta": {
"title": "Load Image"
}
},
"62": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"110:65",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"105": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"108:8",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"121": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"17",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"108:100": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "removal_timestep_alpha-2-1740.safetensors",
"model": [
"108:31",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"108:23": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"108:34",
0
],
"text": "Remove the girl's hat\n"
},
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"108:26": {
"class_type": "FluxGuidance",
"inputs": {
"conditioning": [
"108:23",
0
],
"guidance": 30
},
"_meta": {
"title": "FluxGuidance"
}
},
"108:3": {
"class_type": "KSampler",
"inputs": {
"cfg": 1,
"denoise": 1,
"latent_image": [
"108:38",
2
],
"model": [
"108:39",
0
],
"negative": [
"108:38",
1
],
"positive": [
"108:38",
0
],
"sampler_name": "euler",
"scheduler": "normal",
"seed": 1100974460616450,
"steps": 20
},
"_meta": {
"title": "KSampler"
}
},
"108:31": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "flux.1-fill-dev-OneReward-transformer_fp8.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"108:32": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "ae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"108:34": {
"class_type": "DualCLIPLoader",
"inputs": {
"clip_name1": "clip_l.safetensors",
"clip_name2": "t5xxl_fp16.safetensors",
"device": "default",
"type": "flux"
},
"_meta": {
"title": "Load CLIP (Dual)"
}
},
"108:38": {
"class_type": "InpaintModelConditioning",
"inputs": {
"mask": [
"17",
1
],
"negative": [
"108:46",
0
],
"noise_mask": True,
"pixels": [
"17",
0
],
"positive": [
"108:26",
0
],
"vae": [
"108:32",
0
]
},
"_meta": {
"title": "InpaintModelConditioning"
}
},
"108:39": {
"class_type": "DifferentialDiffusion",
"inputs": {
"model": [
"108:100",
0
],
"strength": 1
},
"_meta": {
"title": "Differential Diffusion"
}
},
"108:46": {
"class_type": "ConditioningZeroOut",
"inputs": {
"conditioning": [
"108:23",
0
]
},
"_meta": {
"title": "Conditioning Zero Out"
}
},
"108:8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"108:3",
0
],
"vae": [
"108:32",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"110:57": {
"class_type": "DualCLIPLoader",
"inputs": {
"clip_name1": "clip_l.safetensors",
"clip_name2": "t5xxl_fp16.safetensors",
"device": "default",
"type": "flux"
},
"_meta": {
"title": "Load CLIP (Dual)"
}
},
"110:58": {
"class_type": "KSampler",
"inputs": {
"cfg": 1,
"denoise": 1,
"latent_image": [
"110:73",
0
],
"model": [
"110:63",
0
],
"negative": [
"110:71",
1
],
"positive": [
"110:71",
0
],
"sampler_name": "euler",
"scheduler": "normal",
"seed": 325184035774450,
"steps": 20
},
"_meta": {
"title": "KSampler"
}
},
"110:59": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "ae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"110:60": {
"class_type": "FluxGuidance",
"inputs": {
"conditioning": [
"110:74",
0
],
"guidance": 30
},
"_meta": {
"title": "FluxGuidance"
}
},
"110:61": {
"class_type": "ConditioningZeroOut",
"inputs": {
"conditioning": [
"110:74",
0
]
},
"_meta": {
"title": "Conditioning Zero Out"
}
},
"110:63": {
"class_type": "DifferentialDiffusion",
"inputs": {
"model": [
"110:64",
0
],
"strength": 1
},
"_meta": {
"title": "Differential Diffusion"
}
},
"110:64": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "flux.1-fill-dev-OneReward-transformer_fp8.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"110:65": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"110:58",
0
],
"vae": [
"110:59",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"110:71": {
"class_type": "InpaintModelConditioning",
"inputs": {
"mask": [
"110:75",
1
],
"negative": [
"110:61",
0
],
"noise_mask": False,
"pixels": [
"110:75",
0
],
"positive": [
"110:60",
0
],
"vae": [
"110:59",
0
]
},
"_meta": {
"title": "InpaintModelConditioning"
}
},
"110:73": {
"class_type": "SetLatentNoiseMask",
"inputs": {
"mask": [
"110:75",
1
],
"samples": [
"110:71",
2
]
},
"_meta": {
"title": "Set Latent Noise Mask"
}
},
"110:74": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"110:57",
0
],
"text": ""
},
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"110:75": {
"class_type": "ImagePadForOutpaint",
"inputs": {
"bottom": 104,
"feathering": 40,
"image": [
"17",
0
],
"left": 40,
"right": 104,
"top": 0
},
"_meta": {
"title": "Pad Image for Outpainting"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)問答
The Flux.1 model is used for inpainting and outpainting tasks, allowing for seamless filling or extension of image areas.
No, this workflow is specifically designed for still images. Video editing would require a different set of tools and models.
You can edit the mask by right-clicking on the Load Image node and selecting Open in 'Maskeditor' to define the areas you want to modify.
Yes, it is recommended to update ComfyUI to ensure compatibility and access to the latest features and models.
相關工作流程
- Flux, Flux.1
Flux.1 [專業版]:文生圖
- Flux.1, Flux
Flux.1 Canny 模型
- Flux.1, Flux
Flux.1 Redux 模型
- Flux.1, Flux
Flux.1 Schnell FP8
- Flux.1, Flux
Flux.1 Schnell Full: 文生圖
- Flux, Flux.1
Flux.1 圖像修復
- Flux.1, Flux
Flux.1 外繪
- Flux, Flux.1
Flux.1 深度 Lora
- Flux.1, Flux
Flux.1 開發專用 fp8: 文生圖
- Flux, Flux.1
Flux.1 開發專用 USO 參考圖產生
- Flux, Flux.1
Flux.1 開發專用:文生圖
- Flux, Flux.1
Flux.1:圖像擴圖