2022-12-10 21:18:03 +00:00
|
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
2023-01-18 10:25:15 +00:00
|
|
|
|
VERSION = '0.1a8'
|
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
|
|
|
|
|
2022-12-21 14:53:50 +00:00
|
|
|
|
DB_HOST = 'localhost:5432'
|
2022-12-11 14:02:55 +00:00
|
|
|
|
DB_USER = 'skynet'
|
|
|
|
|
DB_PASS = 'password'
|
|
|
|
|
DB_NAME = 'skynet'
|
2022-12-10 21:18:03 +00:00
|
|
|
|
|
|
|
|
|
ALGOS = {
|
|
|
|
|
'midj': 'prompthero/openjourney',
|
2022-12-17 14:39:42 +00:00
|
|
|
|
'stable': 'runwayml/stable-diffusion-v1-5',
|
2022-12-10 21:18:03 +00:00
|
|
|
|
'hdanime': 'Linaqruf/anything-v3.0',
|
|
|
|
|
'waifu': 'hakurei/waifu-diffusion',
|
|
|
|
|
'ghibli': 'nitrosocke/Ghibli-Diffusion',
|
|
|
|
|
'van-gogh': 'dallinmackay/Van-Gogh-diffusion',
|
|
|
|
|
'pokemon': 'lambdalabs/sd-pokemon-diffusers',
|
|
|
|
|
'ink': 'Envvi/Inkpunk-Diffusion',
|
|
|
|
|
'robot': 'nousr/robo-diffusion'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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-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:
|
|
|
|
|
|
|
|
|
|
{N.join(ALGOS.keys())}
|
|
|
|
|
|
|
|
|
|
/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'
|
|
|
|
|
]
|
|
|
|
|
|
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
|
|
|
|
|
MAX_WIDTH = 512
|
|
|
|
|
MAX_HEIGHT = 656
|
|
|
|
|
MAX_GUIDANCE = 20
|
|
|
|
|
|
|
|
|
|
DEFAULT_SEED = None
|
|
|
|
|
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
|
|
|
|
|
DEFAULT_ALGO = 'midj'
|
|
|
|
|
DEFAULT_ROLE = 'pleb'
|
|
|
|
|
DEFAULT_UPSCALER = None
|
|
|
|
|
|
2022-12-11 16:06:07 +00:00
|
|
|
|
DEFAULT_CERTS_DIR = 'certs'
|
|
|
|
|
DEFAULT_CERT_WHITELIST_DIR = 'whitelist'
|
|
|
|
|
DEFAULT_CERT_SKYNET_PUB = 'brain.cert'
|
|
|
|
|
DEFAULT_CERT_SKYNET_PRIV = 'brain.key'
|
|
|
|
|
DEFAULT_CERT_DGPU = 'dgpu.key'
|
|
|
|
|
|
2022-12-10 21:18:03 +00:00
|
|
|
|
DEFAULT_RPC_ADDR = 'tcp://127.0.0.1:41000'
|
|
|
|
|
|
|
|
|
|
DEFAULT_DGPU_ADDR = 'tcp://127.0.0.1:41069'
|
2022-12-17 14:39:42 +00:00
|
|
|
|
DEFAULT_DGPU_MAX_TASKS = 2
|
2022-12-10 21:18:03 +00:00
|
|
|
|
DEFAULT_INITAL_ALGOS = ['midj', 'stable', 'ink']
|
|
|
|
|
|
|
|
|
|
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'
|
|
|
|
|
]
|