Skip to content

Commit

Permalink
updated with g. G. /g
Browse files Browse the repository at this point in the history
  • Loading branch information
theofandrich committed Oct 5, 2023
1 parent 781a1ea commit a1a3fee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/modules/sd-images/SDImagesBotBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ export class SDImagesBotBase {
await sleep(5000 * balancerOperaton.queueNumber || 500)
balancerOperaton = await getOperationById(balancerOperaton.id)
}
console.log(balancerOperaton)
console.log('balancer_id: ', balancerOperaton.id)

return {
queueMessageId: message_id,
balancerOperaton
Expand Down
15 changes: 11 additions & 4 deletions src/modules/sd-images/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,21 +118,21 @@ export const parseCtx = (ctx: Context): IOperation | false => {
let lora
let format: MEDIA_FORMAT = MEDIA_FORMAT.JPEG

if (hasCommand(ctx, 'gif')) {
if (hasCommand(ctx, 'gif') || hasCommand(ctx, 'g')) {
command = COMMAND.TEXT_TO_IMAGE
format = MEDIA_FORMAT.GIF
model = getModelByParam('22')
prompt = prompt || '1girl, solo, cherry blossom, hanami, pink flower, white flower, spring season, wisteria, petals, flower, plum blossoms, outdoors, falling petals, black eyes, upper body, from side'
}

if (
(hasCommand(ctx, 'image') ?? hasCommand(ctx, 'imagine')) ?? hasCommand(ctx, 'img')
(hasCommand(ctx, 'image') || hasCommand(ctx, 'imagine')) || hasCommand(ctx, 'img')
) {
command = COMMAND.TEXT_TO_IMAGE
}

if (
(hasCommand(ctx, 'image2') ?? hasCommand(ctx, 'imagine2')) ?? hasCommand(ctx, 'img2')
(hasCommand(ctx, 'image2') || hasCommand(ctx, 'imagine2')) || hasCommand(ctx, 'img2')
) {
command = COMMAND.TEXT_TO_IMAGE
model = model && ({ ...model, serverNumber: 2 })
Expand Down Expand Up @@ -182,11 +182,18 @@ export const parseCtx = (ctx: Context): IOperation | false => {
command = COMMAND.TEXT_TO_IMAGE
}

if (messageText.startsWith('l.')) {
if (messageText.startsWith('l.') ?? messageText.startsWith('L.')) {
model = getModelByParam('xl')
lora = getLoraByParam('logo', model?.baseModel ?? 'SDXL 1.0')
}

if (messageText.startsWith('g.') || messageText.startsWith('G.')) {
command = COMMAND.TEXT_TO_IMAGE
format = MEDIA_FORMAT.GIF
model = getModelByParam('22')
prompt = prompt || '1girl, solo, cherry blossom, hanami, pink flower, white flower, spring season, wisteria, petals, flower, plum blossoms, outdoors, falling petals, black eyes, upper body, from side'
}

if (!model) {
model = MODELS_CONFIGS[0]
}
Expand Down

0 comments on commit a1a3fee

Please sign in to comment.