File size: 1,583 Bytes
4de66a5
 
979d507
 
 
 
 
 
4de66a5
 
 
 
e88fa1a
979d507
e88fa1a
 
 
 
 
 
 
 
0d7c941
 
979d507
 
 
 
a9e23d1
979d507
 
 
 
 
 
 
13170e5
 
979d507
4de66a5
979d507
dcc4895
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
38
39
40
41
42
import os
import gradio as gr
import logging

LOG_FORMAT = '%(asctime)s - %(levelname)s  [%(name)s] %(funcName)s -> %(message)s'
logging.basicConfig(level = logging.DEBUG, format = LOG_FORMAT)
logger = logging.getLogger(__name__)
logger.debug('Logging started')

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)."""

models = [
"models/ItsJayQz/Marvel_WhatIf_Diffusion",
"models/DGSpitzer/Cyberpunk-Anime-Diffusion",
"models/DGSpitzer/Guan-Yu-Diffusion",
"models/wavymulder/portraitplus",
"models/nitrosocke/classic-anim-diffusion",
"models/22h/vintedois-diffusion-v0-1",
"models/dreamlike-art/dreamlike-diffusion-1.0",
"models/stabilityai/stable-diffusion-2-1"
]

custom_model = "models/dreamlike-art/dreamlike-diffusion-1.0"

def selectModel(message):
    message = message.lower()
    c_model=models[0]
    logging.warning('model selected = '+c_model)
    return c_model

sandbox = gr.Interface.load(
    fn= selectModel,
    name= custom_model, 
    title="""AlStable sandbox""",
    inputs = gr.Textbox(label="Prompt", show_label=False, max_lines=2, placeholder="Enter your prompt", elem_id="input-prompt1", 
              gr.Textbox(label="Model", show_label=False, max_lines=2, placeholder="Enter your style", elem_id="input-prompt2"),
    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()