Spaces:
Sleeping
Sleeping
Commit
·
3326f03
1
Parent(s):
7d4f1d1
update
Browse files
app.py
CHANGED
@@ -246,7 +246,7 @@ def text_to_image(guest_id, prompt,keywords,positive_prompt,radio,slider_step,sl
|
|
246 |
prompt = tokenizer.encode(user_prompt)
|
247 |
layout_image = None
|
248 |
else:
|
249 |
-
if len(global_dict[guest_id]['stack']) == 0:
|
250 |
|
251 |
if len(keywords.strip()) == 0:
|
252 |
template = f'Given a prompt that will be used to generate an image, plan the layout of visual text for the image. The size of the image is 128x128. Therefore, all properties of the positions should not exceed 128, including the coordinates of top, left, right, and bottom. All keywords are included in the caption. You dont need to specify the details of font styles. At each line, the format should be keyword left, top, right, bottom. So let us begin. Prompt: {user_prompt}'
|
|
|
246 |
prompt = tokenizer.encode(user_prompt)
|
247 |
layout_image = None
|
248 |
else:
|
249 |
+
if guest_id not in global_dict or len(global_dict[guest_id]['stack']) == 0:
|
250 |
|
251 |
if len(keywords.strip()) == 0:
|
252 |
template = f'Given a prompt that will be used to generate an image, plan the layout of visual text for the image. The size of the image is 128x128. Therefore, all properties of the positions should not exceed 128, including the coordinates of top, left, right, and bottom. All keywords are included in the caption. You dont need to specify the details of font styles. At each line, the format should be keyword left, top, right, bottom. So let us begin. Prompt: {user_prompt}'
|