JingyeChen commited on
Commit
5d34271
1 Parent(s): f5f6fef
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -197,8 +197,8 @@ def text_to_image(prompt,keywords,slider_step,slider_guidance,slider_batch,slide
197
  user_prompt = prompt
198
 
199
  if slider_natural:
200
- user_prompt += ' <|endoftext|>'
201
- composed_prompt = tokenizer.decode(prompt)
202
  else:
203
  if len(stack) == 0:
204
 
@@ -384,7 +384,7 @@ with gr.Blocks() as demo:
384
  with gr.Row():
385
  with gr.Column(scale=1):
386
  prompt = gr.Textbox(label="Input your prompt here.", placeholder="A beautiful city skyline stamp of Shanghai")
387
- keywords = gr.Textbox(label="(Optional) Input your keywords here. Keywords should bu seperate by / (e.g., keyword1/keyword2/...)", placeholder="keyword1/keyword2")
388
 
389
  # 这里加一个会话框
390
 
@@ -409,7 +409,7 @@ with gr.Blocks() as demo:
409
  slider_batch = gr.Slider(minimum=1, maximum=4, value=4, step=1, label="Batch size", info="The number of images to be sampled.")
410
  slider_temperature = gr.Slider(minimum=0.1, maximum=2, value=0.7, step=0.1, label="Temperature", info="Control the diversity of layout planner. Higher value indicates more diversity.")
411
  slider_natural = gr.Checkbox(label="Natural image generation", value=False, info="The text position and content info will not be incorporated.")
412
- slider_seed = gr.Slider(minimum=1, maximum=10000, label="Seed", randomize=True)
413
  button = gr.Button("Generate")
414
 
415
  with gr.Column(scale=1):
 
197
  user_prompt = prompt
198
 
199
  if slider_natural:
200
+ user_prompt = f'<|startoftext|> {user_prompt} <|endoftext|>'
201
+ composed_prompt = user_prompt
202
  else:
203
  if len(stack) == 0:
204
 
 
384
  with gr.Row():
385
  with gr.Column(scale=1):
386
  prompt = gr.Textbox(label="Input your prompt here.", placeholder="A beautiful city skyline stamp of Shanghai")
387
+ keywords = gr.Textbox(label="(Optional) Input your keywords here. Keywords should be seperated by / (e.g., keyword1/keyword2/...)", placeholder="keyword1/keyword2")
388
 
389
  # 这里加一个会话框
390
 
 
409
  slider_batch = gr.Slider(minimum=1, maximum=4, value=4, step=1, label="Batch size", info="The number of images to be sampled.")
410
  slider_temperature = gr.Slider(minimum=0.1, maximum=2, value=0.7, step=0.1, label="Temperature", info="Control the diversity of layout planner. Higher value indicates more diversity.")
411
  slider_natural = gr.Checkbox(label="Natural image generation", value=False, info="The text position and content info will not be incorporated.")
412
+ # slider_seed = gr.Slider(minimum=1, maximum=10000, label="Seed", randomize=True)
413
  button = gr.Button("Generate")
414
 
415
  with gr.Column(scale=1):