1
+ import { SlashCommandBuilder } from 'discord.js' ;
2
+ import { BotCommand } from '../types' ;
3
+ export default function ( ) : BotCommand {
4
+ const command = new SlashCommandBuilder ( )
5
+ . setName ( 'imagine-legacy' )
6
+ . setDescription ( 'Generate images from prompts' )
7
+ . addStringOption ( option =>
8
+ option . setName ( 'prompt' )
9
+ . setDescription ( 'The prompt to generate an image with' )
10
+ . setRequired ( true ) )
11
+ . addIntegerOption ( option =>
12
+ option . setName ( 'width' )
13
+ . setMinValue ( 128 )
14
+ . setMaxValue ( 1024 )
15
+ . setDescription ( 'The width of the generated image' )
16
+ . setChoices (
17
+ { name : '128px' , value : 128 } ,
18
+ { name : '256px' , value : 256 } ,
19
+ { name : '512px' , value : 512 } ,
20
+ { name : '768px' , value : 768 } ,
21
+ { name : '1024px' , value : 1024 }
22
+ ) )
23
+ . addIntegerOption ( option =>
24
+ option . setName ( 'height' )
25
+ . setMinValue ( 128 )
26
+ . setMaxValue ( 1024 )
27
+ . setDescription ( 'The height of the generated image' )
28
+ . setChoices (
29
+ { name : '128px' , value : 128 } ,
30
+ { name : '256px' , value : 256 } ,
31
+ { name : '512px' , value : 512 } ,
32
+ { name : '768px' , value : 768 } ,
33
+ { name : '1024px' , value : 1024 }
34
+ ) )
35
+ . addAttachmentOption ( option =>
36
+ option . setName ( 'image' )
37
+ . setDescription ( 'Inital jpg or png image to generate variations of. Will be resized to the specified width and height' ) )
38
+ . addAttachmentOption ( option =>
39
+ option . setName ( 'mask' )
40
+ . setDescription ( 'Black and white jpg or png image to use as mask for inpainting over init_image' ) )
41
+ . addNumberOption ( option =>
42
+ option . setName ( 'pstrength' )
43
+ . setDescription ( 'Prompt strength when using init image. 1.0 corresponds to full destruction of information in image' )
44
+ . setMinValue ( 0 )
45
+ . setMaxValue ( 1 ) )
46
+ . addIntegerOption ( option =>
47
+ option . setName ( 'numout' )
48
+ . setDescription ( 'How many images to generate with this prompt' )
49
+ . setMinValue ( 1 )
50
+ . setMaxValue ( 4 ) )
51
+ . addIntegerOption ( option =>
52
+ option . setName ( 'numsteps' )
53
+ . setDescription ( 'Number of denoising steps. Default 50' )
54
+ . setMinValue ( 1 )
55
+ . setMaxValue ( 500 ) )
56
+ . addNumberOption ( option =>
57
+ option . setName ( 'guidescale' )
58
+ . setDescription ( 'Scale for classifier-free guidance. Default 7.5' )
59
+ . setMinValue ( 1 )
60
+ . setMaxValue ( 20 ) )
61
+ . addIntegerOption ( option =>
62
+ option . setName ( 'seed' )
63
+ . setDescription ( 'Generation seed. Randomized if not provided' )
64
+ . setMinValue ( 0 )
65
+ . setMaxValue ( 999999999 ) )
66
+
67
+ return {
68
+ command,
69
+ commandJson : command . toJSON ( )
70
+ }
71
+ }
0 commit comments