非官方Black Forest Labs API客户端
项目描述
Black Forest Labs API客户端
这是一个与Black Forest Labs API交互的非官方Python客户端。
$ export BFL_API_KEY="..."
import black_forest_labs
import time
task = black_forest_labs.generate(
"flux-pro",
prompt="ein fantastisches bild",
)
print(f"Task created with id `{task.id}`")
print("Polling for results...", end="", flush=True)
while not task.is_done:
print(".", end="", flush=True)
task = black_forest_labs.get_result(task.id)
time.sleep(1)
print(f"\nTask finished with status `{task.status}`")
if task.result:
print(f"Prompt: {task.result.prompt}")
print(f"Image URL: {task.result.sample}")
Task created with id `ce9e065d-dc90-4633-9c1e-44ea839ed569`
Polling for results............
Task finished with status `Ready`
Prompt: ein fantastisches bild
Image URL: https://bflapistorage.blob.core.windows.net/public/db43e36806f74c1a9c6972127c9d71ea/sample.jpg
项目详情
关闭
black_forest_labs-1.0.0.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 0f38b3fe0e726577120a63221bebfab1bd9eabe065ccfffc530c2f4136e835e1 |
|
MD5 | 81fd4040e8c34970bc2fc4b7b9fcb811 |
|
BLAKE2b-256 | b1e81c6502a49ec127083cf95a250888d451cc24d7b62dac51838d8a25030ff9 |
关闭
black_forest_labs-1.0.0-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 15a3380918565a7324b0e0ffb26586e66bb60adeb27ee096c93a4bb2eeaa4222 |
|
MD5 | ccf7cc148a68c6d226b6e93c363160cd |
|
BLAKE2b-256 | 26e1a4412ff38526c96e137dc36e20a0fc022546f66188a95133632d3b283bb5 |