Update app.py
Browse files
app.py
CHANGED
|
@@ -50,7 +50,7 @@ def generate_txt2img(current_model, prompt, is_negative=False, image_style="None
|
|
| 50 |
elif current_model == "PlaygroundV2 1024px aesthetic":
|
| 51 |
API_URL = "https://api-inference.huggingface.co/models/playgroundai/playground-v2-1024px-aesthetic"
|
| 52 |
|
| 53 |
-
|
| 54 |
API_TOKEN = os.environ.get("HF_READ_TOKEN")
|
| 55 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
| 56 |
|
|
@@ -115,6 +115,18 @@ PTI_SD_DESCRIPTION = '''
|
|
| 115 |
</div>
|
| 116 |
'''
|
| 117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
|
| 119 |
# Creating Gradio interface
|
| 120 |
with gr.Blocks(css=css) as demo:
|
|
@@ -123,7 +135,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 123 |
with gr.Column():
|
| 124 |
current_model = gr.Dropdown(label="Select Model", choices=list_models, value=list_models[1])
|
| 125 |
text_prompt = gr.Textbox(label="Input Prompt", placeholder="Example: woman in the street ", lines=2)
|
| 126 |
-
|
| 127 |
with gr.Column():
|
| 128 |
negative_prompt = gr.Textbox(label="Negative Prompt (optional)", placeholder="Example: blurry, unfocused", lines=2)
|
| 129 |
image_style = gr.Dropdown(label="Select Style", choices=["None style", "Cinematic", "Digital Art", "Portrait"], value="None style")
|
|
|
|
| 50 |
elif current_model == "PlaygroundV2 1024px aesthetic":
|
| 51 |
API_URL = "https://api-inference.huggingface.co/models/playgroundai/playground-v2-1024px-aesthetic"
|
| 52 |
|
| 53 |
+
|
| 54 |
API_TOKEN = os.environ.get("HF_READ_TOKEN")
|
| 55 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
| 56 |
|
|
|
|
| 115 |
</div>
|
| 116 |
'''
|
| 117 |
|
| 118 |
+
# Prompt examples
|
| 119 |
+
prompt_examples = [
|
| 120 |
+
"A blue jay standing on a large basket of rainbow macarons.",
|
| 121 |
+
"A dog looking curiously in the mirror, seeing a cat.",
|
| 122 |
+
"A robot couple fine dining with Eiffel Tower in the background.",
|
| 123 |
+
"A chrome-plated duck with a golden beak arguing with an angry turtle in a forest.",
|
| 124 |
+
"A transparent sculpture of a duck made out of glass. The sculpture is in front of a painting of a landscape.",
|
| 125 |
+
"A cute corgi lives in a house made out of sushi.",
|
| 126 |
+
"A single beam of light enter the room from the ceiling. The beam of light is illuminating an easel. On the easel there is a Rembrandt painting of a raccoon.",
|
| 127 |
+
"A photo of a Corgi dog riding a bike in Times Square. It is wearing sunglasses and a beach hat."
|
| 128 |
+
]
|
| 129 |
+
|
| 130 |
|
| 131 |
# Creating Gradio interface
|
| 132 |
with gr.Blocks(css=css) as demo:
|
|
|
|
| 135 |
with gr.Column():
|
| 136 |
current_model = gr.Dropdown(label="Select Model", choices=list_models, value=list_models[1])
|
| 137 |
text_prompt = gr.Textbox(label="Input Prompt", placeholder="Example: woman in the street ", lines=2)
|
| 138 |
+
text_prompt.examples = prompt_examples
|
| 139 |
with gr.Column():
|
| 140 |
negative_prompt = gr.Textbox(label="Negative Prompt (optional)", placeholder="Example: blurry, unfocused", lines=2)
|
| 141 |
image_style = gr.Dropdown(label="Select Style", choices=["None style", "Cinematic", "Digital Art", "Portrait"], value="None style")
|