Spaces:
Runtime error
Runtime error
# diptych template v0, generate prompt , this will provide a bit change | |
TEMPLATE_0 = """Create a diptych image that consists two images. The left image is {prompt1}; The right image keep everything the same but {edit_action}.""" | |
# diptych template v0.1, generate prompt, this makes the pair follow instruction better | |
TEMPLATE_0_1 = """Create a diptych image consisting of two panels. On the left, {prompt1}; On the right, the same image but {edit_action}.""" | |
# diptych template v1, generate prompt 1 | |
TEMPLATE_1 = """Generate a wide diptych image consists of the left image and right image. \n \ | |
The left image is an image from Prompt1 and the right image is the edit version of the left image from Prompt2 based on an \ | |
Edit Action. \n Please have a white strip separate between the two images. \ | |
Make sure the right image has the minimum change from the left based on the Edit Action. \ | |
Make sure the right image keep all other aspects, such as the scene and image layout, other than that from Edit Action,IDENTICAL. \ | |
Prompt1 for the left image: {prompt1}, Prompt2 for the right image: {prompt2}, Edit Action: {edit_action} """ | |
# given image generate prompt 1 | |
TEMPLATE_2 = """Create a diptych with a similar layout of the provided image, consisting of two panels separated by a white strip. \ | |
The left panel is to be generated following Prompt1 ('{prompt1}'). \ | |
The right panel should be a slightly edited version of the left, created following Prompt2 ('{prompt2}') \ | |
and incorporating a specific Edit Action ('{edit_action}'). \ | |
The changes in the right image should be minimal, and the image should not be flipped.""" | |
# rewrite a dalle3 prompt | |
REWRITE_PROMPT_0 = """Please rewrite the following prompt to make it more clear and concise, and easier for DALLE3 to generate this diptych image follow the prompt.\ | |
The original prompt is: {prompt1}. The output prompt should start with 'REVISED': """ | |
EVALUATION_PROMPT_TEMPLATE_SIMPLE_V1 = """Text Caption: {caption} | |
From 0 to 100, how much do you rate for this Text Caption in terms of the correct and comprehensive description of the image? | |
Do not dominant the rating by a single attribute such as recognition correctness, but a overall rating on the object/scene appearance, position, pose, action, shape, etc., and contents in the background. | |
Do not consider the appropriateness or sensitive descriptors, such as "middle-aged western man", judge based on if it has correct specifications of the object and scenes in image. | |
Provide a few lines for explanation and the rate number at last after "Final Score: ". | |
""" | |
# this prompt help generate lots prompt to extend more prompt cases using GPT4 for training | |
Extend_PROMPT = """please help generate {num} more prompt like the proviced PROMPT, \ | |
please vary as much as possible such as subject, background and edit attributes. \ | |
Make sure it is clear, concise and comprehensive, and easier for DALLE3 to generate this diptych image follow the prompt. \ | |
The output should be a list of json format. for exmaple: [{'prompt_0': 'xxx'}, {'prompt_0': 'xxx'}...]. \ | |
Do not output anything else, all examples should have key 'prompt_0'. PROMPT: {PROMPT}""" | |
# this prompt help mix prompt to extend more prompt cases using GPT4 for training | |
MIX_TWO_PROMPT = """please help generate {num} more prompt follow the similar pattern to the provided PROMPT with a mixed edit action. \ | |
please vary as much as possible such as subject, background and edit attributes based on the given edit. \ | |
Make sure it is clear, concise and comprehensive, and easier for DALLE3 to generate this diptych image follow the prompt. \ | |
The output should be a list of json format. for exmaple: [{'prompt_mix_0': 'xxx'}, {'prompt_mix_0': 'xxx'}...]. Do not output anything else, all examples should have key 'prompt_mix_0'. \ | |
PROMPT: Create a diptych image that consists two images. The left image is {input}, The right image keep everything the same but first add {edit0} and second {edit1}.""" | |
# this will make the description more rich for input prompt and fuse the edit action. | |
REWRITE_INPUT_DESCRIPTIONS = """please enrich the given PROMPT1: {prompt1}, and edit the enriched PROMPT1 using {edit_action}. \ | |
The output prompt start with EDITPROMPT: """ |