fixes and seed changes
This commit is contained in:
parent
c9670473da
commit
7d3fd7ad9a
22
src/main.py
22
src/main.py
@ -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,12 +72,7 @@ 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, "
|
||||
)
|
||||
|
||||
if seed is None:
|
||||
seed = random.randint(0, 2**32 - 1)
|
||||
|
||||
# API-Payload zusammenbauen
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user