Nexa / app.py
Jdifb's picture
Update app.py
8456a34 verified
raw
history blame contribute delete
702 Bytes
import gradio as gr
from diffusers import StableDiffusionPipeline
import torch
# Load the uncensored model (change to any other if needed)
pipe = StableDiffusionPipeline.from_pretrained(
"nolanaat/sd-nsfw", # Uncensored NSFW model
torch_dtype=torch.float32
)
# Move to CPU (or use .to("cuda") if you're on GPU)
pipe = pipe.to("cpu")
def generate(prompt):
image = pipe(prompt, guidance_scale=7.5).images[0]
return image
gr.Interface(
fn=generate,
inputs=gr.Textbox(label="Enter your prompt"),
outputs=gr.Image(type="pil"),
title="NSFW Uncensored Text-to-Image Generator (CPU)",
description="Based on nolanaat/sd-nsfw — runs on CPU (slow, but works)"
).launch()