Reworked configuration to be able to publish the repo (and not expose keys)

This commit is contained in:
Ed 2022-11-17 23:52:59 +01:00
parent 47ce04e15f
commit 07d3f1e6ea
2 changed files with 75 additions and 0 deletions

58
config.py Normal file
View File

@ -0,0 +1,58 @@
from asyncio import PriorityQueue
from telethon import TelegramClient
import logging
import sqlite3
import coloredlogs
import asyncio
from process_queue import *
from config_priv import *
coloredlogs.install(level='INFO')
client = TelegramClient('bot', api_id, api_hash)
conn = sqlite3.connect('ai621.db', isolation_level=None)
conn.row_factory = sqlite3.Row
client.log_channel_id = log_channel_id
client.main_channel_id = main_channel_id
client.media_lock = asyncio.Lock()
client.admin_id = admin_id
log = logging.getLogger('bot')
send_prompt_lock = asyncio.Lock()
enabled_models = ['Yiffy', 'Furry Epoch', 'Zack3D']
fields_template = {
'prompt': None,
'sampler_name': 'k_euler_a',
'cfg_scale': 5.5,
'seed': 'random',
'resolution': '512x512',
'use_upscaling': False,
'steps': 50,
'n': 3,
'models': 'Yiffy',
'negative_prompt': None,
'image': None
}
prompt_template = {
'prompt': None, # ok
'params': {
'sampler_name': 'k_euler_a',
'toggles': [1, 4],
'cfg_scale': 5,
'seed': 'random',
'height': 512,
'width': 512,
'seed_variation': 1,
'use_upscaling': False,
'steps': 50,
'n': 3,
'models': 'Yiffy'
}
}

17
config_priv_template.py Normal file
View File

@ -0,0 +1,17 @@
# Your telegram API_ID should be here
api_id = 12345
# Your telegram API_HASH should be put here
api_hash = 'aaaaaaaaaaaaaaaaaaaa'
# All guests will use this key
default_horde_key = '0000000000'
# Prompts will be sent to this channel (with buttons for banning)
log_channel_id = 000000000000
# Generations will be sent to this channel
main_channel_id = 000000000000
# This is the list of user ids of people who should be able to use the bot as an admin.
admin_id = [00000000,]