ibrohm commited on
Commit
090858a
Β·
1 Parent(s): e76d669

Upgrade AI models: GPT Image + Seedream5, fix Uz-En fallback, clean captions

Browse files
Files changed (1) hide show
  1. bot/bot.js +9 -7
bot/bot.js CHANGED
@@ -874,18 +874,20 @@ if (process.env.BOT_TOKEN && process.env.BOT_TOKEN !== 'YOUR_TELEGRAM_BOT_TOKEN'
874
  ctx.reply(`✍️ *ERKIN AI BANNER*\n${thinLine}\n\nRasmda nima bo'lishini o'zbekcha yoki inglizcha batafsil yozing:\n\n_"Kiyimlar chegirmasi, yozgi aksiya"_\n_"Yangi yil sovg'alari, bayram kayfiyati"_\n_"Go'zal ayollar kiyimlari, zamonaviy moda"_\n\nπŸ’‘ _Qancha batafsil yozsangiz, shuncha sifatli rasm!_`, { parse_mode: 'Markdown' });
875
  });
876
 
877
- // AI rasmni 2 variantda yaratish funksiyasi
878
  async function generateAIBannerVariants(ctx, finalPrompt, originalPrompt) {
879
  const userId = ctx.from.id;
880
  const ts1 = Date.now();
881
  const ts2 = ts1 + 12345;
882
  const encoded = encodeURIComponent(finalPrompt);
883
 
884
- // Hozirgi eng maxsus fotorealistik model: FLUX va Flux-Realism (turli qiyofa va xato oldini olish uchun)
885
- const url1 = `https://image.pollinations.ai/prompt/${encoded}?width=1024&height=430&seed=${ts1}&nologo=true&model=flux`;
886
- const url2 = `https://image.pollinations.ai/prompt/${encoded}?width=1024&height=430&seed=${ts2}&nologo=true&model=flux-realism`;
 
 
887
 
888
- await ctx.reply('⏳ Gemini promptni kengaytirib, Flux 2 ta variant yaratmoqda... (Kuting, 20-40 soniya)');
889
 
890
  try {
891
  // Ikkalasini xavfsiz yuklab olish qotib qolmasligi uchun biroz kutamiz (stagger resquests)
@@ -900,7 +902,7 @@ if (process.env.BOT_TOKEN && process.env.BOT_TOKEN !== 'YOUR_TELEGRAM_BOT_TOKEN'
900
  // 1-variant tekshiriladi
901
  if (res1) {
902
  msg1 = await ctx.replyWithPhoto({ source: res1, filename: 'variant1.jpg' }, {
903
- caption: `🎨 *Variant 1*\nπŸ“ _"${originalPrompt}"_\n\nπŸ” *Gemini yozgan Inglizcha buyruq:* \n\`${finalPrompt}\``,
904
  parse_mode: 'Markdown',
905
  ...Markup.inlineKeyboard([[Markup.button.callback('βœ… Shu rasmni tanlash', 'ai_pick_1')]])
906
  });
@@ -912,7 +914,7 @@ if (process.env.BOT_TOKEN && process.env.BOT_TOKEN !== 'YOUR_TELEGRAM_BOT_TOKEN'
912
  // 2-variant tekshiriladi
913
  if (res2) {
914
  msg2 = await ctx.replyWithPhoto({ source: res2, filename: 'variant2.jpg' }, {
915
- caption: `🎨 *Variant 2*\nπŸ“ _"${originalPrompt}"_\n\nπŸ” *Gemini yozgan Inglizcha buyruq:* \n\`${finalPrompt}\``,
916
  parse_mode: 'Markdown',
917
  ...Markup.inlineKeyboard([[Markup.button.callback('βœ… Shu rasmni tanlash', 'ai_pick_2')]])
918
  });
 
874
  ctx.reply(`✍️ *ERKIN AI BANNER*\n${thinLine}\n\nRasmda nima bo'lishini o'zbekcha yoki inglizcha batafsil yozing:\n\n_"Kiyimlar chegirmasi, yozgi aksiya"_\n_"Yangi yil sovg'alari, bayram kayfiyati"_\n_"Go'zal ayollar kiyimlari, zamonaviy moda"_\n\nπŸ’‘ _Qancha batafsil yozsangiz, shuncha sifatli rasm!_`, { parse_mode: 'Markdown' });
875
  });
876
 
877
+ // AI rasmni 2 variantda yaratish funksiyasi (ENG KUCHLI BEPUL MODELLAR)
878
  async function generateAIBannerVariants(ctx, finalPrompt, originalPrompt) {
879
  const userId = ctx.from.id;
880
  const ts1 = Date.now();
881
  const ts2 = ts1 + 12345;
882
  const encoded = encodeURIComponent(finalPrompt);
883
 
884
+ // 2026 yildagi eng kuchli bepul modellar (Pollinations orqali):
885
+ // Variant 1: GPT Image (OpenAI DALL-E darajasi β€” eng sifatli)
886
+ // Variant 2: Seedream5 (Google DeepMind β€” fotorealistik)
887
+ const url1 = `https://image.pollinations.ai/prompt/${encoded}?width=1024&height=430&seed=${ts1}&nologo=true&model=gptimage`;
888
+ const url2 = `https://image.pollinations.ai/prompt/${encoded}?width=1024&height=430&seed=${ts2}&nologo=true&model=seedream5`;
889
 
890
+ await ctx.reply('⏳ *2 ta super model* ishga tushmoqda...\n\nπŸ”Ή GPT Image (OpenAI)\nπŸ”Ή Seedream5 (Google)\n\n_Kuting, 20-60 soniya..._', { parse_mode: 'Markdown' });
891
 
892
  try {
893
  // Ikkalasini xavfsiz yuklab olish qotib qolmasligi uchun biroz kutamiz (stagger resquests)
 
902
  // 1-variant tekshiriladi
903
  if (res1) {
904
  msg1 = await ctx.replyWithPhoto({ source: res1, filename: 'variant1.jpg' }, {
905
+ caption: `🎨 *Variant 1 β€” GPT Image (OpenAI)*\nπŸ“ _"${originalPrompt}"_`,
906
  parse_mode: 'Markdown',
907
  ...Markup.inlineKeyboard([[Markup.button.callback('βœ… Shu rasmni tanlash', 'ai_pick_1')]])
908
  });
 
914
  // 2-variant tekshiriladi
915
  if (res2) {
916
  msg2 = await ctx.replyWithPhoto({ source: res2, filename: 'variant2.jpg' }, {
917
+ caption: `🎨 *Variant 2 β€” Seedream5 (Google)*\nπŸ“ _"${originalPrompt}"_`,
918
  parse_mode: 'Markdown',
919
  ...Markup.inlineKeyboard([[Markup.button.callback('βœ… Shu rasmni tanlash', 'ai_pick_2')]])
920
  });