om-app AlStable commited on
Commit
7f461cb
0 Parent(s):

Duplicate from AlStable/stable-diffusion-2-1

Browse files

Co-authored-by: clifford padraig <[email protected]>

Files changed (3) hide show
  1. .gitattributes +34 -0
  2. README.md +13 -0
  3. app.py +47 -0
.gitattributes ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Stable Diffusion 2 1
3
+ emoji: 🤗
4
+ colorFrom: indigo
5
+ colorTo: purple
6
+ sdk: gradio
7
+ sdk_version: 3.15.0
8
+ app_file: app.py
9
+ pinned: false
10
+ duplicated_from: AlStable/stable-diffusion-2-1
11
+ ---
12
+
13
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import gradio as gr
3
+
4
+ API_KEY=os.environ.get('HUGGING_FACE_HUB_TOKEN', None)
5
+ article = """---
6
+ This space was created using [SD Space Creator](https://huggingface.co/spaces/anzorq/sd-space-creator)."""
7
+
8
+ class Model:
9
+ def __init__(self, name, path="", prefix=""):
10
+ self.name = name
11
+ self.path = path
12
+ self.prefix = prefix
13
+ self.pipe_t2i = None
14
+ self.pipe_i2i = None
15
+
16
+ models = [
17
+ Model("Marvel","models/ItsJayQz/Marvel_WhatIf_Diffusion", "whatif style"),
18
+ Model("Cyberpunk Anime Diffusion", "models/DGSpitzer/Cyberpunk-Anime-Diffusion", "dgs illustration style"),
19
+ Model("Guan Yu Diffusion", "models/DGSpitzer/Guan-Yu-Diffusion", "Guan-Yu style"),
20
+ Model("Portrait plus", "models/wavymulder/portraitplus", "portrait+ style"),
21
+ Model("classic Disney", "models/nitrosocke/classic-anim-diffusion", "classic disney style"),
22
+ Model("SD21","models/stabilityai/stable-diffusion-2-1", "sd21 default style")
23
+ ]
24
+
25
+ custom_model = "models/stabilityai/stable-diffusion-2-1"
26
+
27
+ def selectModel(message):
28
+ message = message.lower()
29
+ for i in range(len(models)):
30
+ if message.find(models[i].prefix)!=-1:
31
+ c_model=models[i].path
32
+ return c_model
33
+ else:
34
+ c_model=models[i].path
35
+ return c_model
36
+
37
+ sandbox = gr.Interface.load(
38
+ fn= selectModel,
39
+ name= custom_model,
40
+ title="""AlStable sandbox""",
41
+ inputs = gr.Textbox(label="Prompt", show_label=False, max_lines=2, placeholder="Enter your prompt", elem_id="input-prompt"),
42
+ description="""Demo for <a href="https://huggingface.co/stabilityai/stable-diffusion-2-1">AlStable</a> Stable Diffusion model.""",
43
+ article=article,
44
+ api_key=API_KEY
45
+ )
46
+
47
+ sandbox.queue(concurrency_count=20).launch()