Add option groups for star citizen and palworld, also add optional model to use for /sd but the option isnt showing up in testing

This commit is contained in:
Luke Robles 2024-01-25 10:58:29 -08:00
parent b9326e3c6a
commit 21d1db750d
4 changed files with 30 additions and 9 deletions

4
app/cogs/palworld.py Normal file → Executable file
View File

@ -7,7 +7,9 @@ class PalWorld(commands.Cog):
def __init__(self, bot):
self.bot: commands.Bot = bot
@commands.slash_command(
palworld = discord.SlashCommandGroup("palworld", "Palworld related commands")
@palworld.command(
guild_ids=None,
name="elements",
description="Posts an infographic about which Pal elements are weak/strong against which",

View File

@ -26,8 +26,19 @@ class StableDiffusion(commands.Cog):
description="An optional set of negatives you want to pass to stable diffusion",
required=False,
)
@option(
"model_name",
description="The SD model you want to use for this render",
default="dreamshaper 6.31 baked VAE",
choices=["dreamshaper 6.31 baked VAE", "absolutereality_v181", "dreamshaper_8"],
required=True,
)
async def sd(
self, ctx: commands.Context, positive_prompt: str, negative_prompt: str
self,
ctx: commands.Context,
positive_prompt: str,
negative_prompt: str,
model_name: str,
):
allowed_channels = ["stable-diffusion", "bot-testing"]
if ctx.channel.name in allowed_channels:
@ -68,6 +79,7 @@ class StableDiffusion(commands.Cog):
or "(bad-image-v2-39000:0.8), (bad_prompt_version2:0.8), (bad-hands-5:1.1), (EasyNegative:0.8), (NG_DeepNegative_V1_4T:0.8), (bad-artist-anime:0.7),(deformed iris, deformed pupils, bad eyes, semi-realistic:1.4), (worst quality, low quality:1.3), (blurry:1.2), (greyscale, monochrome:1.1), (poorly drawn face), cloned face, cross eyed , extra fingers, mutated hands, (fused fingers), (too many fingers), (missing arms), (missing legs), (extra arms), (extra legs), (poorly drawn hands), (bad anatomy), (bad proportions), cropped, lowres, text, jpeg artifacts, signature, watermark, username, artist name, trademark, watermark, title, multiple view, Reference sheet, long neck, Out of Frame, B&W, logo, Watermark, bad artist, blur, blurry, text, b&w, 3d, bad art, poorly drawn, disfigured, deformed, extra limbs, ugly hands, extra fingers, canvas frame, cartoon, 3d, disfigured, bad art, deformed, extra limbs, weird colors, duplicate, morbid, mutilated, out of frame, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, ugly, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, out of frame, ugly, extra limbs, bad anatomy, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, mutated hands, fused fingers, too many fingers, long neck, Photoshop, video game, ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, mutation, mutated, extra limbs, extra legs, extra arms, disfigured, deformed, cross-eye, body out of frame, bad art, bad anatomy, 3d render",
steps=steps,
enable_upscale=enable_upscale,
model_name=model_name,
)
await original_message.edit(
content="",

View File

@ -19,7 +19,11 @@ class StarCitizen(commands.Cog):
self.bot: commands.Bot = bot
self.poll_status_page.start()
@commands.slash_command(
starcitizen = discord.SlashCommandGroup(
"starcitizen", "StarCitizen related commands"
)
@starcitizen.command(
guild_ids=None,
name="medpens",
description="Posts an infographic about which medpens to use for which injuries in Star Citizen",
@ -27,7 +31,7 @@ class StarCitizen(commands.Cog):
async def post_medpen_guide(self, ctx: commands.Context):
await ctx.respond("https://i.redd.it/lfswlf5c13t71.png")
@commands.slash_command(
@starcitizen.command(
guild_ids=None,
name="drugs",
description="Returns a list of all the drugs in game sorted by their price",
@ -80,7 +84,7 @@ class StarCitizen(commands.Cog):
return all_ships
@commands.slash_command(
@starcitizen.command(
guild_ids=None,
name="ship",
description="Query the star citizen database about a ship",
@ -195,7 +199,7 @@ class StarCitizen(commands.Cog):
]
return all_commodities
@commands.slash_command(
@starcitizen.command(
guild_ids=None,
name="price",
description="Returns the price of Items in Star Citizen",
@ -219,7 +223,7 @@ class StarCitizen(commands.Cog):
embed = await star_citizen.get_price(commodity=commodity, scu=scu)
await ctx.send_followup(embed=embed)
@commands.slash_command(
@starcitizen.command(
guild_ids=None,
name="trade",
description="Calculates the most profitable route for a given commodity",
@ -334,7 +338,7 @@ class StarCitizen(commands.Cog):
await star_citizen.send_alert(self, channel=channel_id, embed=embed)
@commands.slash_command(
@starcitizen.command(
guild_ids=None,
name="rsifind",
description="Pull up info about a player from their RSI profile",

View File

@ -4,7 +4,9 @@ import httpx
import tempfile
async def generate_image(ip, port, positives, negatives, steps, enable_upscale):
async def generate_image(
ip, port, positives, negatives, steps, enable_upscale, model_name
):
url = "http://" + ip + ":" + port + "/sdapi/v1/txt2img"
json_data = {
@ -19,6 +21,7 @@ async def generate_image(ip, port, positives, negatives, steps, enable_upscale):
"hr_resize_x": 1024,
"hr_resize_y": 1024,
"alwayson_scripts": {"ADetailer": {"args": [{"ad_model": "face_yolov8n.pt"}]}},
"override_settings": {"sd_model_checkpoint": model_name},
}
client = httpx.AsyncClient()