AbdulRahim07 commited on
Commit
e6252c6
·
1 Parent(s): 46c61e8

Create hugg

Browse files
Files changed (1) hide show
  1. hugg +17 -0
hugg ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler
2
+ import torch
3
+
4
+ model_id = "stabilityai/stable-diffusion-2"
5
+ scheduler = EulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
6
+ pipe = StableDiffusionPipeline.from_pretrained(model_id, scheduler=scheduler, torch_dtype=torch.float16)
7
+ pipe = pipe.to("cuda")
8
+
9
+
10
+ def imageg(pro):
11
+ image = pipe(pro).images[0]
12
+ return image
13
+
14
+ import gradio as gr
15
+ wb=gr.Interface(fn=imageg,inputs="text",outputs="image",title="Raheem Kolachi")
16
+
17
+ wb.launch(share=True)