Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files
README.md
CHANGED
|
@@ -1,13 +1,16 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Timtical Comic Creator
|
| 2 |
+
|
| 3 |
+
An AI-powered comic-style image generator built using Stable Diffusion and Gradio. Type in a prompt, and watch your imagination come to life!
|
| 4 |
+
|
| 5 |
+
## Features
|
| 6 |
+
- Prompt-to-image generation
|
| 7 |
+
- Based on `stabilityai/stable-diffusion-2-1`
|
| 8 |
+
- Free and public Hugging Face Space
|
| 9 |
+
|
| 10 |
+
## Example Prompts
|
| 11 |
+
- "A futuristic ninja in a neon-lit alley"
|
| 12 |
+
- "A warrior elf with silver armor and blue flames"
|
| 13 |
+
- "A space pirate with a robotic arm and a cosmic background"
|
| 14 |
+
|
| 15 |
+
## Licensing
|
| 16 |
+
Make sure your use of this app complies with the Stable Diffusion license for commercial applications.
|
app.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from diffusers import StableDiffusionPipeline
|
| 3 |
+
import torch
|
| 4 |
+
|
| 5 |
+
# Load the Stable Diffusion model
|
| 6 |
+
pipe = StableDiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1", torch_dtype=torch.float16)
|
| 7 |
+
pipe = pipe.to("cuda")
|
| 8 |
+
|
| 9 |
+
# Define the image generation function
|
| 10 |
+
def generate_comic_image(prompt):
|
| 11 |
+
image = pipe(prompt).images[0]
|
| 12 |
+
return image
|
| 13 |
+
|
| 14 |
+
# Launch the Gradio interface
|
| 15 |
+
gr.Interface(
|
| 16 |
+
fn=generate_comic_image,
|
| 17 |
+
inputs=gr.Textbox(label="Describe your comic scene or character", placeholder="e.g. A futuristic bounty hunter with glowing eyes"),
|
| 18 |
+
outputs=gr.Image(label="Generated Comic Image"),
|
| 19 |
+
title="Timtical Comic Creator",
|
| 20 |
+
description="Type a prompt to generate comic-style images using AI. Built with Stable Diffusion."
|
| 21 |
+
).launch()
|