labubu太火热,实体店难买,二手太贵,本文教你用 Labubu Doll Generator Lora, 借助together ai的免费api,通过简单的提示词生成我们想要的labubu图片。
本文涉及基本python代码,若不想自己折腾,可以在线体验: ai-labubu-generator

简略步骤:
- 获取 Labubu lora 链接
- 注册together ai 获取免费1美元api额度
- python调用api生成图片
获取 Labubu lora 链接
lora 路径: huggingface.co/spaces/yeek...
我们不用下载到本地,这个链接后面会作为一个参数传入到together ai 里面。
除非你是本地部署模型lora,需要下载
注册together ai
这一步主要是获取together api的密钥
访问together.ai注册,注册完成之后进入到个人账号页面,点击Dashboard,可以看到赠送的1美元额度。如下图左侧API Keys
, 点击复制密钥

python 调用
安装together 依赖
pip install --upgrade together
调用 together api:
- copy 代码
- 修改密钥api_key
- 修改提示词
- 运行,等待5-10s即可出结果
python
from together import Together
# Set the API key directly in the client
client = Together(api_key="") # 设置密钥
help(client.images.generate)
response = client.images.generate(
# 设置自己的提示词
prompt="Labubu style, walking on street with a pack", #"labubu style, an astronaut",
# 基模,不用改
model="black-forest-labs/FLUX.1-dev-lora",
width=768,
height=1024,
image_loras=[
{
"path": "https://huggingface.co/spaces/yeekal/lbb_lora/resolve/main/flux_lbb_style_v1_2ksteps.safetensors?download=true",
"scale": 0.8
}
],
steps=30
)
# 生成之后会返回一个图片url链接,点击即可看到结果
print(response.data[0].url)
图片中的宽高可以自定义设置,但是根据together ai的收费说明,图片越大,费用越贵。代码里面默认设置的768x1024
清晰度也够用了,可以不用改,下面的图都是这个尺寸,可以参照以下。
生成结果展示
懒人试用链接: ai-labubu-generator


懒人试用链接: ai-labubu-generator