weijiang2024 commited on
Commit
1b34141
·
verified ·
1 Parent(s): 9bb48f6

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -43,7 +43,7 @@ def send_generation_request(
43
 
44
  return response
45
 
46
- def generate_image(prompt, negative_prompt, seed, aspect_ratio, output_format, model):
47
  """Generates an image using the SD3 API."""
48
 
49
  host = os.environ["STABILITY_HOST"]
@@ -72,6 +72,12 @@ def generate_image(prompt, negative_prompt, seed, aspect_ratio, output_format, m
72
  # Convert image to PIL format
73
  image = Image.open(BytesIO(output_image))
74
 
 
 
 
 
 
 
75
  return image
76
 
77
  """
@@ -85,6 +91,12 @@ Cost Rule
85
  interface = gr.Interface(
86
  fn=generate_image,
87
  inputs=[
 
 
 
 
 
 
88
  gr.Textbox(label="广告整体正向描述", placeholder="This dreamlike digital art captures a vibrant, kaleidoscopic bird in a lush rainforest"),
89
  gr.Textbox(label="广告整体负向描述", placeholder="Optional"),
90
  gr.Number(label="算法随机种子", value=0),
 
43
 
44
  return response
45
 
46
+ def generate_image(brand_name, type, coupon_info, address, prompt, negative_prompt, seed, aspect_ratio, output_format, model):
47
  """Generates an image using the SD3 API."""
48
 
49
  host = os.environ["STABILITY_HOST"]
 
72
  # Convert image to PIL format
73
  image = Image.open(BytesIO(output_image))
74
 
75
+ # TODO: 新增 品牌名称
76
+ # TODO: 新增 类别
77
+ # TODO: 新增 折扣信息
78
+ # TODO: 新增 实体店地址
79
+ # TODO: 新增 编号控制
80
+ # TODO: 新增 智能客服联系人QR Code
81
  return image
82
 
83
  """
 
91
  interface = gr.Interface(
92
  fn=generate_image,
93
  inputs=[
94
+ gr.Textbox(label="品牌名称", placeholder="样例: AI原优舍"),
95
+ gr.Dropdown(label="类别", choices=["服饰", "饮食", "健身", "按摩", "公益"], value="服饰"),
96
+ gr.Textbox(label="折扣信息", placeholder="样例: 凭券全场任意两件正价八折"),
97
+ gr.Textbox(label="实体店地址", placeholder="样例: 广州市麦栏街20号野隐大楼3层"),
98
+ # TODO: 新增 编号控制按钮
99
+ # TODO: 新增 智能客服联系人QR Code
100
  gr.Textbox(label="广告整体正向描述", placeholder="This dreamlike digital art captures a vibrant, kaleidoscopic bird in a lush rainforest"),
101
  gr.Textbox(label="广告整体负向描述", placeholder="Optional"),
102
  gr.Number(label="算法随机种子", value=0),