mygyasir's picture
Update app.py
322d798
raw
history blame
1.16 kB
from diffusers import DiffusionPipeline
import torch
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, use_safetensors=True, variant="fp16")
pipe.to("cuda:0")
import gradio as gr
def gi(prompt):
image = pipe(prompt+" hyper real image ,ultra – detailed ,hyper – realistic,8K,photo - hyper realistic, hyper detail – Image",negative_prompt="mutated Image,bad anatomy,deformed Image,extra finger,mutated face,deformed pupils, deformed iris,mutated hands and fingers,deformed hand and fingers ,deformed eye,extra fingers ,less fingers,unrealistic Image,Low Quality,Bad Quality,deformed objects,unrealistic objects,blurry,mutated body,deformed body,deformed leg,mutated leg,deformed foot,mutated foot,deformed shoes,deformed buildings,deformed enviroment,deformed things,bad look,deformed chicks,deformed animals,bad quality,deformed dress").images[0]
return image
input_box = gr.components.Textbox(placeholder="Enter your text and generate Image in less than a minute!!...")
iface = gr.Interface(fn=gi,inputs=input_box,outputs="image",title="Stable Diffusion AI Image Generator")
iface.launch()