Fixed bugs with SD disable
This commit is contained in:
parent
7c65e55d92
commit
04bbf41a5a
1 changed files with 17 additions and 17 deletions
|
|
@ -191,8 +191,8 @@ async def look_at(ctx, look=False):
|
||||||
metadata = ""
|
metadata = ""
|
||||||
if look:
|
if look:
|
||||||
url = os.getenv('stablediffusion_url')
|
url = os.getenv('stablediffusion_url')
|
||||||
if url == "disabled":
|
if url == "disabled":
|
||||||
return
|
return
|
||||||
for attachment in ctx.attachments:
|
for attachment in ctx.attachments:
|
||||||
if attachment.url.endswith(('.jpg', '.png')):
|
if attachment.url.endswith(('.jpg', '.png')):
|
||||||
print("image seen")
|
print("image seen")
|
||||||
|
|
@ -924,8 +924,8 @@ async def website(ctx):
|
||||||
|
|
||||||
async def generate_images(local_folder, image_list):
|
async def generate_images(local_folder, image_list):
|
||||||
url = os.getenv('stablediffusion_url')
|
url = os.getenv('stablediffusion_url')
|
||||||
if url == "disabled":
|
if url == "disabled":
|
||||||
return
|
return
|
||||||
file_list = []
|
file_list = []
|
||||||
async with aiohttp.ClientSession() as session:
|
async with aiohttp.ClientSession() as session:
|
||||||
for image in image_list:
|
for image in image_list:
|
||||||
|
|
@ -1023,8 +1023,8 @@ async def feature(ctx):
|
||||||
@bot.command()
|
@bot.command()
|
||||||
async def draw(ctx):
|
async def draw(ctx):
|
||||||
url = os.getenv('stablediffusion_url')
|
url = os.getenv('stablediffusion_url')
|
||||||
if url == "disabled":
|
if url == "disabled":
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
if " " in ctx.message.content:
|
if " " in ctx.message.content:
|
||||||
amount = ctx.message.content.split(" ", maxsplit=1)[1]
|
amount = ctx.message.content.split(" ", maxsplit=1)[1]
|
||||||
|
|
@ -1188,8 +1188,8 @@ async def personality(ctx):
|
||||||
@bot.command()
|
@bot.command()
|
||||||
async def change_model(ctx, model_choice='0'):
|
async def change_model(ctx, model_choice='0'):
|
||||||
url = os.getenv('stablediffusion_url')
|
url = os.getenv('stablediffusion_url')
|
||||||
if url == "disabled":
|
if url == "disabled":
|
||||||
return
|
return
|
||||||
response = requests.get(url=f'{url}/sdapi/v1/options')
|
response = requests.get(url=f'{url}/sdapi/v1/options')
|
||||||
config_json = response.json()
|
config_json = response.json()
|
||||||
current_model = config_json["sd_model_checkpoint"]
|
current_model = config_json["sd_model_checkpoint"]
|
||||||
|
|
@ -1226,9 +1226,9 @@ async def change_model(ctx, model_choice='0'):
|
||||||
@bot.command()
|
@bot.command()
|
||||||
async def imagine(ctx):
|
async def imagine(ctx):
|
||||||
url = os.getenv('stablediffusion_url')
|
url = os.getenv('stablediffusion_url')
|
||||||
if url == "disabled":
|
if url == "disabled":
|
||||||
await ctx.send("Command is currently disabled.")
|
await ctx.send("Command is currently disabled.")
|
||||||
return
|
return
|
||||||
prompt = ctx.message.content.split(" ", maxsplit=1)[1]
|
prompt = ctx.message.content.split(" ", maxsplit=1)[1]
|
||||||
key_value_pairs, prompt = extract_key_value_pairs(prompt)
|
key_value_pairs, prompt = extract_key_value_pairs(prompt)
|
||||||
#negative_prompt = ""
|
#negative_prompt = ""
|
||||||
|
|
@ -1278,9 +1278,9 @@ async def imagine(ctx):
|
||||||
@bot.command()
|
@bot.command()
|
||||||
async def describe(ctx):
|
async def describe(ctx):
|
||||||
url = os.getenv('stablediffusion_url')
|
url = os.getenv('stablediffusion_url')
|
||||||
if url == "disabled":
|
if url == "disabled":
|
||||||
await ctx.send("Command is currently disabled")
|
await ctx.send("Command is currently disabled")
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
if ctx.message.content.startswith("!describe "):
|
if ctx.message.content.startswith("!describe "):
|
||||||
file_url = ctx.message.content.split(" ", maxsplit=1)[1]
|
file_url = ctx.message.content.split(" ", maxsplit=1)[1]
|
||||||
|
|
@ -1316,9 +1316,9 @@ async def describe(ctx):
|
||||||
async def reimagine(ctx):
|
async def reimagine(ctx):
|
||||||
#see http://127.0.0.1:7860/docs for info, must be running stable diffusion with --api
|
#see http://127.0.0.1:7860/docs for info, must be running stable diffusion with --api
|
||||||
url = os.getenv('stablediffusion_url')
|
url = os.getenv('stablediffusion_url')
|
||||||
if url == "disabled":
|
if url == "disabled":
|
||||||
await ctx.send("Command is currently disabled")
|
await ctx.send("Command is currently disabled")
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
file_url = ctx.message.content.split(" ", maxsplit=2)[1]
|
file_url = ctx.message.content.split(" ", maxsplit=2)[1]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue