Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| model = gr.load("models/Purz/face-projection") | |
| def generate_image(text, negative_prompt=None): | |
| if not negative_prompt: | |
| negative_prompt = "low quality, distorted, overly saturated, text artifacts, out of focus" | |
| print(f"Generating with prompt: {text}, negative prompt: {negative_prompt}") | |
| return model(text, negative_prompt=negative_prompt) | |
| examples = [ | |
| ["Humanoid Cat Warrior, Full View", "blurry, low quality"], | |
| ["Warhammer Sisterhood", "overexposed, low resolution"], | |
| ["Future Robots war", "too dark, cluttered background"], | |
| ["Fantasy dragon", "distorted, unbalanced composition"] | |
| ] | |
| interface = gr.Interface( | |
| fn=generate_image, | |
| inputs=[ | |
| gr.Textbox(label="Type here your imagination:", placeholder="Type or click an example..."), | |
| gr.Textbox(label="Negative Prompt (optional)", placeholder="Describe what to avoid, e.g., blurry, overly saturated...") | |
| ], | |
| outputs=gr.Image(label="Generated Image"), | |
| examples=examples, | |
| theme="NoCrypt/miku", | |
| description="Sorry for the inconvenience. The model is currently running on the CPU, which might affect performance. We appreciate your understanding.", | |
| ) | |
| interface.launch() | |