salehalmansour commited on
Commit
c11f1e4
1 Parent(s): a76605a

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ import gradio as gr
3
+ from diffusers import StableDiffusionPipeline
4
+
5
+ class CFG:
6
+ device = 'cpu'
7
+ seed = 42
8
+ Generator = torch.Generator(device).manual_seed(seed)
9
+ image_gen_steps = 35
10
+ image_gen_model_id = 'stabilityai/stable-diffusion-2'
11
+ image_gen_size = (400, 400)
12
+ image_gen_guidance_scale = 9
13
+
14
+ image_gen_model = StableDiffusionPipeline.from_pretrained(
15
+ CFG.image_gen_model_id, torch_dtype=torch.float32,
16
+ revision="fp16", use_auth_token='hf_'
17
+ )