2022-12-10 21:18:03 +00:00
|
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
2023-06-04 20:51:43 +00:00
|
|
|
|
VERSION = '0.1a10'
|
2022-12-21 14:53:50 +00:00
|
|
|
|
|
2022-12-17 14:39:42 +00:00
|
|
|
|
DOCKER_RUNTIME_CUDA = 'skynet:runtime-cuda'
|
2022-12-10 21:18:03 +00:00
|
|
|
|
|
2023-06-04 20:51:43 +00:00
|
|
|
|
MODELS = {
|
2023-07-19 19:21:57 +00:00
|
|
|
|
'prompthero/openjourney': { 'short': 'midj'},
|
|
|
|
|
'runwayml/stable-diffusion-v1-5': { 'short': 'stable'},
|
2023-07-19 21:25:28 +00:00
|
|
|
|
'stabilityai/stable-diffusion-2-1-base': { 'short': 'stable2'},
|
2023-07-19 19:34:06 +00:00
|
|
|
|
'snowkidy/stable-diffusion-xl-base-0.9': { 'short': 'stablexl'},
|
2023-07-19 19:21:57 +00:00
|
|
|
|
'Linaqruf/anything-v3.0': { 'short': 'hdanime'},
|
|
|
|
|
'hakurei/waifu-diffusion': { 'short': 'waifu'},
|
|
|
|
|
'nitrosocke/Ghibli-Diffusion': { 'short': 'ghibli'},
|
|
|
|
|
'dallinmackay/Van-Gogh-diffusion': { 'short': 'van-gogh'},
|
|
|
|
|
'lambdalabs/sd-pokemon-diffusers': { 'short': 'pokemon'},
|
|
|
|
|
'Envvi/Inkpunk-Diffusion': { 'short': 'ink'},
|
|
|
|
|
'nousr/robo-diffusion': { 'short': 'robot'}
|
2022-12-10 21:18:03 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-06-06 15:27:40 +00:00
|
|
|
|
SHORT_NAMES = [
|
|
|
|
|
model_info['short']
|
|
|
|
|
for model_info in MODELS.values()
|
|
|
|
|
]
|
|
|
|
|
|
2023-06-04 20:51:43 +00:00
|
|
|
|
def get_model_by_shortname(short: str):
|
|
|
|
|
for model, info in MODELS.items():
|
|
|
|
|
if short == info['short']:
|
|
|
|
|
return model
|
|
|
|
|
|
2022-12-10 21:18:03 +00:00
|
|
|
|
N = '\n'
|
|
|
|
|
HELP_TEXT = f'''
|
2022-12-21 14:53:50 +00:00
|
|
|
|
test art bot v{VERSION}
|
2022-12-10 21:18:03 +00:00
|
|
|
|
|
|
|
|
|
commands work on a user per user basis!
|
|
|
|
|
config is individual to each user!
|
|
|
|
|
|
|
|
|
|
/txt2img TEXT - request an image based on a prompt
|
2023-07-21 20:57:54 +00:00
|
|
|
|
/img2img <attach_image> TEXT - request an image base on an image and a promtp
|
2022-12-10 21:18:03 +00:00
|
|
|
|
|
2023-01-18 10:25:15 +00:00
|
|
|
|
/redo - redo last command (only works for txt2img for now!)
|
2022-12-10 21:18:03 +00:00
|
|
|
|
|
|
|
|
|
/help step - get info on step config option
|
|
|
|
|
/help guidance - get info on guidance config option
|
|
|
|
|
|
|
|
|
|
/cool - list of cool words to use
|
|
|
|
|
/stats - user statistics
|
|
|
|
|
/donate - see donation info
|
|
|
|
|
|
|
|
|
|
/config algo NAME - select AI to use one of:
|
2023-06-06 15:27:40 +00:00
|
|
|
|
/config model NAME - select AI to use one of:
|
2022-12-10 21:18:03 +00:00
|
|
|
|
|
2023-06-06 15:27:40 +00:00
|
|
|
|
{N.join(SHORT_NAMES)}
|
2022-12-10 21:18:03 +00:00
|
|
|
|
|
|
|
|
|
/config step NUMBER - set amount of iterations
|
|
|
|
|
/config seed NUMBER - set the seed, deterministic results!
|
|
|
|
|
/config size WIDTH HEIGHT - set size in pixels
|
|
|
|
|
/config guidance NUMBER - prompt text importance
|
|
|
|
|
'''
|
|
|
|
|
|
2022-12-21 14:53:50 +00:00
|
|
|
|
UNKNOWN_CMD_TEXT = 'Unknown command! Try sending \"/help\"'
|
2022-12-10 21:18:03 +00:00
|
|
|
|
|
|
|
|
|
DONATION_INFO = '0xf95335682DF281FFaB7E104EB87B69625d9622B6\ngoal: 25/650usd'
|
|
|
|
|
|
|
|
|
|
COOL_WORDS = [
|
|
|
|
|
'cyberpunk',
|
|
|
|
|
'soviet propaganda poster',
|
|
|
|
|
'rastafari',
|
|
|
|
|
'cannabis',
|
|
|
|
|
'art deco',
|
|
|
|
|
'H R Giger Necronom IV',
|
|
|
|
|
'dimethyltryptamine',
|
|
|
|
|
'lysergic',
|
|
|
|
|
'slut',
|
|
|
|
|
'psilocybin',
|
|
|
|
|
'trippy',
|
|
|
|
|
'lucy in the sky with diamonds',
|
|
|
|
|
'fractal',
|
|
|
|
|
'da vinci',
|
|
|
|
|
'pencil illustration',
|
|
|
|
|
'blueprint',
|
|
|
|
|
'internal diagram',
|
|
|
|
|
'baroque',
|
|
|
|
|
'the last judgment',
|
|
|
|
|
'michelangelo'
|
|
|
|
|
]
|
|
|
|
|
|
2023-07-19 17:28:08 +00:00
|
|
|
|
CLEAN_COOL_WORDS = [
|
|
|
|
|
'cyberpunk',
|
|
|
|
|
'soviet propaganda poster',
|
|
|
|
|
'rastafari',
|
|
|
|
|
'cannabis',
|
|
|
|
|
'art deco',
|
|
|
|
|
'H R Giger Necronom IV',
|
|
|
|
|
'dimethyltryptamine',
|
|
|
|
|
'lysergic',
|
|
|
|
|
'psilocybin',
|
|
|
|
|
'trippy',
|
|
|
|
|
'lucy in the sky with diamonds',
|
|
|
|
|
'fractal',
|
|
|
|
|
'da vinci',
|
|
|
|
|
'pencil illustration',
|
|
|
|
|
'blueprint',
|
|
|
|
|
'internal diagram',
|
|
|
|
|
'baroque',
|
|
|
|
|
'the last judgment',
|
|
|
|
|
'michelangelo'
|
|
|
|
|
]
|
|
|
|
|
|
2022-12-21 14:53:50 +00:00
|
|
|
|
HELP_TOPICS = {
|
|
|
|
|
'step': '''
|
|
|
|
|
Diffusion models are iterative processes – a repeated cycle that starts with a\
|
2022-12-10 21:18:03 +00:00
|
|
|
|
random noise generated from text input. With each step, some noise is removed\
|
|
|
|
|
, resulting in a higher-quality image over time. The repetition stops when the\
|
|
|
|
|
desired number of steps completes.
|
|
|
|
|
|
2022-12-21 14:53:50 +00:00
|
|
|
|
Around 25 sampling steps are usually enough to achieve high-quality images. Us\
|
2022-12-10 21:18:03 +00:00
|
|
|
|
ing more may produce a slightly different picture, but not necessarily better \
|
|
|
|
|
quality.
|
2022-12-21 14:53:50 +00:00
|
|
|
|
''',
|
2022-12-10 21:18:03 +00:00
|
|
|
|
|
2022-12-21 14:53:50 +00:00
|
|
|
|
'guidance': '''
|
|
|
|
|
The guidance scale is a parameter that controls how much the image generation\
|
2022-12-10 21:18:03 +00:00
|
|
|
|
process follows the text prompt. The higher the value, the more image sticks\
|
|
|
|
|
to a given text input.
|
|
|
|
|
'''
|
2022-12-21 14:53:50 +00:00
|
|
|
|
}
|
2022-12-10 21:18:03 +00:00
|
|
|
|
|
|
|
|
|
HELP_UNKWNOWN_PARAM = 'don\'t have any info on that.'
|
|
|
|
|
|
|
|
|
|
GROUP_ID = -1001541979235
|
|
|
|
|
|
|
|
|
|
MP_ENABLED_ROLES = ['god']
|
|
|
|
|
|
|
|
|
|
MIN_STEP = 1
|
|
|
|
|
MAX_STEP = 100
|
2023-07-20 21:02:14 +00:00
|
|
|
|
MAX_WIDTH = 1024
|
|
|
|
|
MAX_HEIGHT = 1024
|
2022-12-10 21:18:03 +00:00
|
|
|
|
MAX_GUIDANCE = 20
|
|
|
|
|
|
2023-05-28 23:17:55 +00:00
|
|
|
|
DEFAULT_SEED = None
|
2022-12-10 21:18:03 +00:00
|
|
|
|
DEFAULT_WIDTH = 512
|
|
|
|
|
DEFAULT_HEIGHT = 512
|
|
|
|
|
DEFAULT_GUIDANCE = 7.5
|
2023-01-18 10:04:08 +00:00
|
|
|
|
DEFAULT_STRENGTH = 0.5
|
2022-12-10 21:18:03 +00:00
|
|
|
|
DEFAULT_STEP = 35
|
|
|
|
|
DEFAULT_CREDITS = 10
|
2023-06-06 15:27:40 +00:00
|
|
|
|
DEFAULT_MODEL = list(MODELS.keys())[0]
|
2022-12-10 21:18:03 +00:00
|
|
|
|
DEFAULT_ROLE = 'pleb'
|
|
|
|
|
DEFAULT_UPSCALER = None
|
|
|
|
|
|
2023-01-22 15:12:33 +00:00
|
|
|
|
DEFAULT_CONFIG_PATH = 'skynet.ini'
|
2022-12-11 16:06:07 +00:00
|
|
|
|
|
2023-06-04 20:51:43 +00:00
|
|
|
|
DEFAULT_INITAL_MODELS = [
|
|
|
|
|
'prompthero/openjourney',
|
|
|
|
|
'runwayml/stable-diffusion-v1-5'
|
|
|
|
|
]
|
2022-12-10 21:18:03 +00:00
|
|
|
|
|
|
|
|
|
DATE_FORMAT = '%B the %dth %Y, %H:%M:%S'
|
|
|
|
|
|
|
|
|
|
CONFIG_ATTRS = [
|
|
|
|
|
'algo',
|
|
|
|
|
'step',
|
|
|
|
|
'width',
|
|
|
|
|
'height',
|
|
|
|
|
'seed',
|
|
|
|
|
'guidance',
|
2023-01-18 10:47:02 +00:00
|
|
|
|
'strength',
|
2022-12-10 21:18:03 +00:00
|
|
|
|
'upscaler'
|
|
|
|
|
]
|
2023-06-03 15:44:22 +00:00
|
|
|
|
|
2023-06-10 12:27:04 +00:00
|
|
|
|
DEFAULT_DOMAIN = 'skygpu.net'
|
|
|
|
|
|
2023-06-03 15:44:22 +00:00
|
|
|
|
DEFAULT_IPFS_REMOTE = '/ip4/169.197.140.154/tcp/4001/p2p/12D3KooWKWogLFNEcNNMKnzU7Snrnuj84RZdMBg3sLiQSQc51oEv'
|