fixes and seed changes
Some checks failed
Safety Check / safety-check (push) Successful in -3s
Build and Push Docker Image / build (push) Successful in -9s
Code Quality Check / quality-check (push) Failing after 12s

This commit is contained in:
wirehack7 2025-05-01 13:40:08 +02:00
parent c9670473da
commit 7d3fd7ad9a
Signed by: wirehack7
GPG Key ID: C9F4CF85BA505ADC

View File

@ -30,14 +30,23 @@ async def on_ready():
@app_commands.describe(
prompt="What should be generated?",
undesired_prompt="What should be avoided? (optional)",
orientation="portrait or landscape (Standard: portrait)"
orientation="portrait or landscape (Standard: portrait)",
seed="Optional seed (integer). If empty, a random one will be generated"
)
async def generate(
interaction: discord.Interaction,
prompt: str,
undesired_prompt: str = "",
orientation: str = "portrait"
orientation: str = "portrait",
seed: int = None
):
default_negative = (
"blurry, lowres, error, film grain, scan artifacts, worst quality, bad quality, jpeg artifacts, "
"very displeasing, chromatic aberration, multiple views, logo, too many watermarks, white blank page, "
"blank page, watermarks, watermark, text, "
)
if interaction.channel.id != ALLOWED_CHANNEL_ID:
await interaction.response.send_message(
"This command isn't allowed here.",
@ -51,7 +60,7 @@ async def generate(
await interaction.followup.send(f"Prompt too long! Maximum {MAX_PROMPT_LENGTH} chars allowed.")
return
if len(negative) > MAX_PROMPT_LENGTH:
if len(default_negative + undesired_prompt.strip()) > MAX_PROMPT_LENGTH:
await interaction.followup.send(f"Negative Prompt too long! Maximum {MAX_PROMPT_LENGTH} chars allowed.")
return
@ -63,13 +72,8 @@ async def generate(
else:
width, height = 832, 1216
default_negative = (
"blurry, lowres, error, film grain, scan artifacts, worst quality, bad quality, jpeg artifacts, "
"very displeasing, chromatic aberration, multiple views, logo, too many watermarks, white blank page, "
"blank page, watermarks, watermark, text, "
)
seed = random.randint(0, 2**32 - 1)
if seed is None:
seed = random.randint(0, 2**32 - 1)
# API-Payload zusammenbauen
payload = {