Skip to main content
bfl/flux-pro-1.0-canny 的 API 参考文档,由 Comfy Router 提供,模型来自 Black Forest Labs。

快速开始

你的 Comfy 工作区中创建一个密钥,并将其导出为 COMFY_API_KEY。Python 和 TypeScript 代码片段使用 Comfy SDK(pip install comfy-sdknpm install @comfyorg/sdk);cURL 代码片段则是通过原始 HTTP 发起的相同调用。 模型 ID: bfl/flux-pro-1.0-canny 端点: POST https://api.comfy.org/v2/models/bfl/flux-pro-1.0-canny

Schema

Input

integer
默认值:"200"
High threshold for Canny edge detectionRange: 0 to 500
integer
默认值:"50"
Low threshold for Canny edge detectionRange: 0 to 500
string
Base64 encoded image to use as control input if no preprocessed image is provided
number
默认值:"30"
Guidance strength for the image generation processRange: 1 to 100
`jpeg`, `png`, `webp`
默认值:"\"jpeg\""
Output format for the generated image. Can be ‘jpeg’ or ‘png’.
string
Optional pre-processed image that will bypass the control preprocessing step
string
必填
Text prompt for image generation
boolean
默认值:"false"
Whether to perform upsampling on the prompt
integer
默认值:"2"
Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict.Range: 0 to 6
integer
Optional seed for reproducibility
integer
默认值:"50"
Number of steps for the image generation processRange: 15 to 50
string
Optional secret for webhook signature verification
string (uri)
URL to receive webhook notifications
Generated from the schema Router serves at GET /v2/models/bfl/flux-pro-1.0-canny/openapi.json, the same document it validates a call against before the request reaches the provider.

Output

number
Provider-reported cost in credits, populated once the task is Ready.Format: float
string
必填
BFL task identifier.
number
Optional generation progress reported by BFL.Range: 0 to 1Format: float
object
必填
The finished generation. Not nullable here: this component’s required entry is a promise that a 200 carries the result, and a nullable result would reduce it to a key-presence check.
number
Provider-reported cost of the generation. This is BFL’s number, not the Comfy charge.Format: double
number
Provider-reported generation duration in seconds.Format: double
number
Provider-reported completion time of the generation, in seconds since the Unix epoch. double for the same reason as start_time.Format: double
string
The prompt the generation actually ran, after any prompt upsampling.
string (uri)
Signed URL for the generated asset. Router re-hosts the asset onto Comfy storage and rewrites this field, so it is normally a Comfy-hosted URL valid for up to 24 hours - signed for 24 hours when minted, and replayed from a 23-hour memo, so a later poll can hand back one with as little as an hour left; a leaf whose re-host could not be performed keeps BFL’s own short-lived delivery URL instead - roughly two hours for video, roughly ten minutes for images. Either way the link expires, so download the asset rather than storing the URL.Format: uri
integer
The seed the generation used, whether supplied or chosen by the provider. Declared int64 because BFL returns seeds above 2^31 (e.g. 2784347701), which an unformatted integer generates as a 32-bit field in many SDK generators.Format: int64
number
Provider-reported start time of the generation, in seconds since the Unix epoch. double, not float: float32 spacing near a present-day epoch value is ~128 seconds, which collapses a whole generation’s span to a single decoded value.Format: double
string
必填
Task status: Pending, Reasoning, Generating, Ready, Request Moderated, Content Moderated, Error, or Task not found.

示例

输入

输出

发布前须知

SDK 会生成 Idempotency-Key 并在自动重试中复用它。手动重试时,请复用原始 key。Router 最长可保持连接 10 分钟。 请求失败时,Router 会发送 X-Comfy-Error-Type 响应头说明原因。422 表示 Router 在调用提供商之前就拒绝了输入。生成的资源请及时下载,因为结果链接会过期

请求头

身份验证、幂等性、请求 ID、错误分类、重试节奏、消费限额。

使用 Router API

模型发现、校验错误、重试与计费。

限制

Router 目前不支持的功能,以及替代方案。