File size: 1,365 Bytes
4de66a5
 
 
 
 
 
 
 
0d7c941
 
 
 
 
 
 
 
d516123
 
 
0d7c941
e25f345
cde57f0
 
e25f345
cde57f0
4475ccb
0d7c941
 
cde57f0
0d7c941
4de66a5
0d7c941
dcf7046
 
4de66a5
 
0d7c941
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import os
import gradio as gr

API_KEY=os.environ.get('HUGGING_FACE_HUB_TOKEN', None)

article = """---
This space was created using [SD Space Creator](https://huggingface.co/spaces/anzorq/sd-space-creator)."""

class Model:
    def __init__(self, name, path="", prefix=""):
        self.name = name
        self.path = path
        self.prefix = prefix
        self.pipe_t2i = None
        self.pipe_i2i = None

"""
AssertionError: parameter: src must be one of dict_keys(['huggingface', 'models', 'spaces'])
"""
models = [
   Model("Marvel","models/ItsJayQz/Marvel_WhatIf_Diffusion", "whatif style"), 
   Model("Cyberpunk Anime Diffusion", "models/DGSpitzer/Cyberpunk-Anime-Diffusion", "dgs illustration style "),
   Model("Guan Yu Diffusion", "models/DGSpitzer/Guan-Yu-Diffusion", "Guan-Yu"),
   Model("Portrait plus", "models/wavymulder/portraitplus", "portrait+ style"),
   Model("classic Disney", "models/nitrosocke/classic-anim-diffusion", "classic disney style"),
   Model("SD21","models/stabilityai/stable-diffusion-2-1", "")
]

custom_model = models[3].path

gr.Interface.load(
    name= custom_model,
    title="""AlStable sandbox""",
    description="""Demo for <a href="https://huggingface.co/stabilityai/stable-diffusion-2-1">AlStable</a> Stable Diffusion model.""",
    article=article,
    api_key=API_KEY,
    ).queue(concurrency_count=20).launch()