import requests
import json
import base64
配置SD WebUI API地址
url = "http://127.0.0.1:7860/sdapi/v1/txt2img"
核心Prompt:精准描述潮汕英歌舞与甜品特征
prompt = """
(masterpiece, best quality), 3d render, c4d style, blind box style,
cute chaozhou yingge dance character, traditional chinese opera makeup,
holding wooden sticks, standing on a delicious cream cake,
starry night background, glowing lights, pastel colors,
intricate details, commercial photography lighting --ar 3:4
"""
负面提示词:保证画面干净
negative_prompt = "low quality, bad anatomy, text, watermark, ugly, deformed"
payload = {
"prompt": prompt,
"negative_prompt": negative_prompt,
"steps": 30,
"width": 768,
"height": 1024,
"cfg_scale": 7,
"sampler_name": "DPM++ 2M Karras",
这里可以加载你训练好的英歌舞LoRA模型
"alwayson_scripts": {
"controlnet": {
"args": [
{
"module": "openpose_full",
"model": "control_v11p_sd15_openpose",
"weight": 1.0
}
]
}
}
}
def generate_yingge_ip():
print("正在生成英歌舞IP设计图...")
response = requests.post(url, json=payload)
if response.status_code == 200:
r = response.json()
保存生成的图片
image_data = base64.b64decode(r'images'0)
with open("yingge_cake_design.png", "wb") as f:
f.write(image_data)
print("生成成功!已保存为 yingge_cake_design.png")
else:
print(f"生成失败: {response.text}")
if name == "main":
generate_yingge_ip()
💡 关于本设计与IP授权
本文展示的《普宁英歌舞×星空蛋糕》仅为AI生成概念图(已申请外观专利)。
我目前专注于潮汕国潮IP的数字化设计,提供以下合作模式:
设计授权: 烘焙店、茶饮店可使用此设计图制作海报、菜单或复刻产品(非买断,仅授权)。
定制设计: 可为1688工厂、线下门店批量生成专属的国潮包装、T恤图案或甜品造型。
技术交流: 如需获取完整Prompt或探讨SDXL商业落地,欢迎评论区交流或私信。
注:本人无实体工厂,专注前端设计与IP孵化,欢迎有生产能力的工厂老板对接!
