Skip to content

Commit

Permalink
mistaken argument name
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeldaFan0225 committed Nov 18, 2022
1 parent 9010410 commit 4497662
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/commands/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const command_data = new SlashCommandBuilder()
command_data
.addBooleanOption(
new SlashCommandBooleanOption()
.setName("use_realesrgan")
.setName("use_real_esrgan")
.setDescription("Whether to use RealESRGAN_x4plus post processing")
)
}
Expand Down Expand Up @@ -180,8 +180,8 @@ export default class extends Command {
const seed = ctx.interaction.options.getString("seed")
let height = ctx.interaction.options.getInteger("height") ?? ctx.client.config.default_res?.height ?? 512
let width = ctx.interaction.options.getInteger("width") ?? ctx.client.config.default_res?.width ?? 512
const gfpgan = !!ctx.interaction.options.getBoolean("gfpgan") ?? ctx.client.config.default_gfpgan
const real_esrgan = !!ctx.interaction.options.getBoolean("real_esrgan") ?? ctx.client.config.default_real_esrgan
const gfpgan = !!ctx.interaction.options.getBoolean("use_gfpgan") ?? ctx.client.config.default_gfpgan
const real_esrgan = !!ctx.interaction.options.getBoolean("use_real_esrgan") ?? ctx.client.config.default_real_esrgan
const seed_variation = ctx.interaction.options.getInteger("seed_variation") ?? 1
const steps = ctx.interaction.options.getInteger("steps") ?? ctx.client.config.default_steps ?? 30
const amount = ctx.interaction.options.getInteger("amount") ?? 1
Expand Down Expand Up @@ -246,7 +246,7 @@ export default class extends Command {
const post_processing = []

if(gfpgan) post_processing.push(ModelGenerationInputPostProcessingTypes.GFPGAN)
if(real_esrgan) post_processing.push(ModelGenerationInputPostProcessingTypes["RealESRGAN_x4plus"])
if(real_esrgan) post_processing.push(ModelGenerationInputPostProcessingTypes.RealESRGAN_x4plus)

const generation_data: GenerationInput = {
prompt,
Expand All @@ -270,6 +270,8 @@ export default class extends Command {
models: !model ? undefined : model === "YOLO" ? [] : [model],
source_image: img_data?.toString("base64")
}

console.log(generation_data)

if(token === "0000000000" && ((generation_data.params?.width ?? 512) > 1024 || (generation_data.params?.height ?? 512) > 1024 || (generation_data.params?.steps ?? 512) > 100)) return ctx.error({error: "You need to be logged in to generate images with a size over 1024*1024 or more than 100 steps"})

Expand Down

0 comments on commit 4497662

Please sign in to comment.