AlPrompt / app.py
AlStable's picture
Update app.py
7163d04
raw
history blame
1.34 kB
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, models):
message = message.lower()
return models
sandbox = gr.Interface.load(
fn= selectModel,
name= custom_model,
title="""AlStable sandbox""",
inputs = ["text", gr.Dropdown(models)],
output = "image",
description="""Demo for <a href="https://huggingface.co./stabilityai/stable-diffusion-2-1">AlStable</a> Stable Diffusion model.""",
article=article,
api_key=API_KEY
)
sandbox.queue(concurrency_count=20).launch()