File size: 911 Bytes
8c77367
3dc74fc
9c3795c
3dc74fc
8c77367
 
 
 
 
 
3dc74fc
8c77367
3dc74fc
8c77367
 
 
 
 
 
3dc74fc
8c77367
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from diffusers import StableDiffusionXLPipeline
import gradio as gr
import torch

def segMindImage(prompt, negative_prompt):
  pipe = StableDiffusionXLPipeline.from_pretrained("segmind/SSD-1B", torch_dtype=torch.float16, use_safetensors=True, variant="fp16")
  pipe.to("cuda")
  prompt = prompt # Your prompt here
  neg_prompt = negative_prompt # Negative prompt here
  image = pipe(prompt=prompt, negative_prompt=neg_prompt).images[0]

  return image

  app = gr.Interface(segMindImage,
                   inputs = [gr.Text(label="Prompt",placeholder="Write Prompt"),gr.Text(label="Negative Prompt",placeholder="Write Negative Prompt")],
                   outputs = gr.Image(label="Image"),
                   css =".gradio-container {background-image: linear-gradient(#7F7FD5, #91EAE4, #A3C9E2)}",
                   theme = gr.themes.Soft(),
                   title = "SD Image Diffusion")

  app.launch()