Canstralian's picture
Update app.py
6a1f0d6 verified
raw
history blame contribute delete
758 Bytes
import gradio as gr
from transformers import pipeline
# Load the pre-trained model for text-to-image generation (assuming the model is compatible with this task)
generator = pipeline("text-to-image", model="username/lustlyai-flux-lustly-ai-nsfw-v1")
def generate_image_from_prompt(prompt):
image = generator(prompt)
return image[0] # Assuming the generator returns a list of images
# Create the Gradio interface
iface = gr.Interface(
fn=generate_image_from_prompt,
inputs=gr.Textbox(label="Enter Your NSFW Prompt"),
outputs=gr.Image(label="Generated Image"),
title="Lustlyai-Flux NSFW Image Generator",
description="Generate NSFW images based on your text prompts.",
theme="dark"
)
# Launch the interface
iface.launch()