xulh
commited on
Commit
·
051a649
1
Parent(s):
d285fdf
代码初始化
Browse files- picture/generalImg.py +2 -1
picture/generalImg.py
CHANGED
@@ -13,7 +13,8 @@ async def generate_image(token: str = Body(...), prompt: str = Body(...)):
|
|
13 |
# 创建InferenceClient
|
14 |
client = InferenceClient("black-forest-labs/FLUX.1-dev", token=token)
|
15 |
# 使用text_to_image方法生成图片
|
16 |
-
image = client.text_to_image(prompt=prompt, height=256, width=256
|
|
|
17 |
|
18 |
# 将PIL.Image对象转换为byte数据
|
19 |
buffered = BytesIO()
|
|
|
13 |
# 创建InferenceClient
|
14 |
client = InferenceClient("black-forest-labs/FLUX.1-dev", token=token)
|
15 |
# 使用text_to_image方法生成图片
|
16 |
+
image = client.text_to_image(prompt=prompt, height=256, width=256,
|
17 |
+
negative_prompt="low quality, blurry, bad anatomy")
|
18 |
|
19 |
# 将PIL.Image对象转换为byte数据
|
20 |
buffered = BytesIO()
|