Spaces:
Runtime error
Runtime error
import gradio as gr | |
import os | |
import requests | |
SYSTEM_PROMPT = "As an LLM, your job is to generate detailed prompts that start with generate the image, for image generation models based on user input. Be descriptive and specific, but also make sure your prompts are clear and concise." | |
TITLE = "Image Prompter" | |
EXAMPLE_INPUT = "A Reflective cat between stars." | |
# Path to your local image file | |
enticing_image_path = "C:/Users/alain/Downloads/enticing_image.jpg" | |
html_temp = """ | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body { | |
font-family: Arial, sans-serif; | |
} | |
.container { | |
text-align: center; | |
background-color: #f4f4f4; | |
padding: 20px; | |
border-radius: 10px; | |
} | |
h1 { | |
color: #333; | |
} | |
.enticing-image { | |
width: 100px; | |
height: 100px; | |
border-radius: 50%; | |
position: absolute; | |
top: 0; | |
right: 0; | |
} | |
.main-image { | |
width: 300px; | |
height: 300px; | |
border-radius: 50%; | |
} | |
p { | |
font-size: 18px; | |
color: #555; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="container"> | |
<h1>{}</h1> | |
<div class="enticing-image"> | |
<img src='{}' alt='Enticing Image'> | |
</div> | |
<img class="main-image" src='https://huggingface.co/spaces/NerdN/open-gpt-Image-Prompter/blob/main/_45a03b4d-ea0f-4b81-873d-ff6b10461d52.jpg' alt='Your Image'> | |
<p>{}</p> | |
</div> | |
</body> | |
</html> | |
""".format(TITLE, enticing_image_path, EXAMPLE_INPUT) | |
# Rest of the code remains unchanged | |
demo = gr.ChatInterface(test_preview_chatbot, chatbot=chatbot_preview, textbox=textbox_preview, title=None, html=html_temp) | |
demo.launch(share=True) | |