selfit-camera commited on
Commit
02e2b41
·
1 Parent(s): 46520c5
Files changed (22) hide show
  1. app.py +11 -7
  2. i18n/ar.json +1 -1
  3. i18n/da.json +1 -1
  4. i18n/de.json +1 -1
  5. i18n/en.json +1 -1
  6. i18n/es.json +1 -1
  7. i18n/fi.json +1 -1
  8. i18n/fr.json +1 -1
  9. i18n/he.json +1 -1
  10. i18n/id.json +1 -1
  11. i18n/it.json +1 -1
  12. i18n/ja.json +1 -1
  13. i18n/nl.json +1 -1
  14. i18n/no.json +1 -1
  15. i18n/pt.json +1 -1
  16. i18n/ru.json +1 -1
  17. i18n/sv.json +1 -1
  18. i18n/tr.json +1 -1
  19. i18n/uk.json +1 -1
  20. i18n/vi.json +1 -1
  21. i18n/zh.json +1 -1
  22. util.py +12 -6
app.py CHANGED
@@ -41,6 +41,7 @@ PHASE_1_WINDOW = 3 # 15-25 tries: 5 minutes
41
  PHASE_2_WINDOW = 10 # 25-32 tries: 10 minutes
42
  PHASE_3_WINDOW = 20 # 32-40 tries: 20 minutes
43
  MAX_IMAGES_PER_WINDOW = 2 # Max images per time window
 
44
 
45
  IP_Dict = {}
46
  # IP generation statistics and time window tracking
@@ -58,7 +59,7 @@ IP_Query_Results = {} # Track async query results
58
 
59
  # Restricted countries list (these countries have lower usage limits)
60
  RESTRICTED_COUNTRIES = ["印度", "巴基斯坦"]
61
- RESTRICTED_COUNTRY_LIMIT = 3 # Max usage for restricted countries
62
 
63
  country_dict = {
64
  "zh": ["中国", "香港"],
@@ -648,14 +649,18 @@ def edit_image_interface(input_image, prompt, lang, request: gr.Request, progres
648
  print(f"⚠️ Progress update failed: {e}")
649
 
650
  try:
 
 
 
 
651
  # Record generation attempt (before actual generation to ensure correct count)
652
  record_generation_attempt(client_ip, current_phase)
653
  updated_count = get_ip_generation_count(client_ip)
654
 
655
- print(f"✅ Processing started - IP: {client_ip}, phase: {current_phase}, total count: {updated_count}, prompt: {prompt.strip()}", flush=True)
656
 
657
- # Call image editing processing function
658
- input_image_url, result_url, message, task_uuid = process_image_edit(input_image, prompt.strip(), None, progress_callback)
659
 
660
  if result_url:
661
  print(f"✅ Processing completed successfully - IP: {client_ip}, result_url: {result_url}, task_uuid: {task_uuid}", flush=True)
@@ -948,7 +953,6 @@ def create_app():
948
  </div>
949
  """)
950
 
951
- # 🌟 NEW: Multi-Image Editing Announcement Banner with language selector
952
  with gr.Row(elem_classes=["news-banner-row"]):
953
  with gr.Column(scale=1, min_width=400):
954
  news_banner = gr.HTML(f"""
@@ -973,7 +977,7 @@ def create_app():
973
  ">
974
  <span style="color: white; font-weight: 600; font-size: 1.0em;">
975
  {t('news_banner_prefix', 'en')}
976
- <a href="https://huggingface.co/spaces/Selfit/Multi-Image-Edit" target="_blank" style="
977
  color: white;
978
  text-decoration: none;
979
  border-bottom: 1px solid rgba(255,255,255,0.5);
@@ -1320,7 +1324,7 @@ def create_app():
1320
  <div class="breathing-banner" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); margin: 5px auto 5px auto; padding: 6px 40px; border-radius: 20px; max-width: 700px; box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3); text-align: center;">
1321
  <span style="color: white; font-weight: 600; font-size: 1.0em;">
1322
  {t('news_banner_prefix', lang)}
1323
- <a href="https://huggingface.co/spaces/Selfit/Multi-Image-Edit" target="_blank" style="color: white; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.5); transition: all 0.3s ease;" onmouseover="this.style.borderBottom='1px solid white'" onmouseout="this.style.borderBottom='1px solid rgba(255,255,255,0.5)'">
1324
  {t('news_banner_link', lang)}
1325
  </a>
1326
  </span>
 
41
  PHASE_2_WINDOW = 10 # 25-32 tries: 10 minutes
42
  PHASE_3_WINDOW = 20 # 32-40 tries: 20 minutes
43
  MAX_IMAGES_PER_WINDOW = 2 # Max images per time window
44
+ high_priority_n = 2 # 每个ip开头几个任务是高优先级的
45
 
46
  IP_Dict = {}
47
  # IP generation statistics and time window tracking
 
59
 
60
  # Restricted countries list (these countries have lower usage limits)
61
  RESTRICTED_COUNTRIES = ["印度", "巴基斯坦"]
62
+ RESTRICTED_COUNTRY_LIMIT = 2 # Max usage for restricted countries
63
 
64
  country_dict = {
65
  "zh": ["中国", "香港"],
 
649
  print(f"⚠️ Progress update failed: {e}")
650
 
651
  try:
652
+ # Determine priority before recording generation attempt
653
+ # First high_priority_n tasks for each IP get priority=1
654
+ task_priority = 1 if current_count < high_priority_n else 0
655
+
656
  # Record generation attempt (before actual generation to ensure correct count)
657
  record_generation_attempt(client_ip, current_phase)
658
  updated_count = get_ip_generation_count(client_ip)
659
 
660
+ print(f"✅ Processing started - IP: {client_ip}, phase: {current_phase}, total count: {updated_count}, priority: {task_priority}, prompt: {prompt.strip()}", flush=True)
661
 
662
+ # Call image editing processing function with priority
663
+ input_image_url, result_url, message, task_uuid = process_image_edit(input_image, prompt.strip(), None, progress_callback, priority=task_priority)
664
 
665
  if result_url:
666
  print(f"✅ Processing completed successfully - IP: {client_ip}, result_url: {result_url}, task_uuid: {task_uuid}", flush=True)
 
953
  </div>
954
  """)
955
 
 
956
  with gr.Row(elem_classes=["news-banner-row"]):
957
  with gr.Column(scale=1, min_width=400):
958
  news_banner = gr.HTML(f"""
 
977
  ">
978
  <span style="color: white; font-weight: 600; font-size: 1.0em;">
979
  {t('news_banner_prefix', 'en')}
980
+ <a href="https://omnicreator.net/text-to-image" target="_blank" style="
981
  color: white;
982
  text-decoration: none;
983
  border-bottom: 1px solid rgba(255,255,255,0.5);
 
1324
  <div class="breathing-banner" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); margin: 5px auto 5px auto; padding: 6px 40px; border-radius: 20px; max-width: 700px; box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3); text-align: center;">
1325
  <span style="color: white; font-weight: 600; font-size: 1.0em;">
1326
  {t('news_banner_prefix', lang)}
1327
+ <a href="https://omnicreator.net/text-to-image" target="_blank" style="color: white; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.5); transition: all 0.3s ease;" onmouseover="this.style.borderBottom='1px solid white'" onmouseout="this.style.borderBottom='1px solid rgba(255,255,255,0.5)'">
1328
  {t('news_banner_link', lang)}
1329
  </a>
1330
  </span>
i18n/ar.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "محرر الصور بالذكاء الاصطناعي",
3
  "header_title": "🎨 محرر الصور بالذكاء الاصطناعي",
4
  "news_banner_prefix": "🚀 أخبار: ",
5
- "news_banner_link": "أول أداة لتحرير الصور المتعددة في العالم ",
6
  "global_editor_tab": "🌍 تحرير شامل",
7
  "upload_image_header": "### 📸 رفع صورة",
8
  "upload_image_label": "اختر صورة لتحريرها",
 
2
  "app_title": "محرر الصور بالذكاء الاصطناعي",
3
  "header_title": "🎨 محرر الصور بالذكاء الاصطناعي",
4
  "news_banner_prefix": "🚀 أخبار: ",
5
+ "news_banner_link": "Text-to-Image متاح الآن أفضل توليد بشري على الإطلاق!",
6
  "global_editor_tab": "🌍 تحرير شامل",
7
  "upload_image_header": "### 📸 رفع صورة",
8
  "upload_image_label": "اختر صورة لتحريرها",
i18n/da.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "AI Billededitor",
3
  "header_title": "🎨 AI Billededitor",
4
  "news_banner_prefix": "🚀 Nyheder: ",
5
- "news_banner_link": "Verdens første redigeringsværktøj til flere billeder ",
6
  "global_editor_tab": "🌍 Global Redigering",
7
  "upload_image_header": "### 📸 Upload Billede",
8
  "upload_image_label": "Vælg et billede at redigere",
 
2
  "app_title": "AI Billededitor",
3
  "header_title": "🎨 AI Billededitor",
4
  "news_banner_prefix": "🚀 Nyheder: ",
5
+ "news_banner_link": "Text-to-Image er live Den bedste menneskelige generering nogensinde!",
6
  "global_editor_tab": "🌍 Global Redigering",
7
  "upload_image_header": "### 📸 Upload Billede",
8
  "upload_image_label": "Vælg et billede at redigere",
i18n/de.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "KI-Bildeditor",
3
  "header_title": "🎨 KI-Bildeditor",
4
  "news_banner_prefix": "🚀 Neuigkeiten: ",
5
- "news_banner_link": "Das weltweit erste Multi-Bild-Bearbeitungstool ",
6
  "global_editor_tab": "🌍 Globale Bearbeitung",
7
  "upload_image_header": "### 📸 Bild hochladen",
8
  "upload_image_label": "Wählen Sie ein Bild zur Bearbeitung aus",
 
2
  "app_title": "KI-Bildeditor",
3
  "header_title": "🎨 KI-Bildeditor",
4
  "news_banner_prefix": "🚀 Neuigkeiten: ",
5
+ "news_banner_link": "Text-to-Image ist live Die beste menschliche Generierung aller Zeiten!",
6
  "global_editor_tab": "🌍 Globale Bearbeitung",
7
  "upload_image_header": "### 📸 Bild hochladen",
8
  "upload_image_label": "Wählen Sie ein Bild zur Bearbeitung aus",
i18n/en.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "AI Image Editor",
3
  "header_title": "🎨 AI Image Editor",
4
  "news_banner_prefix": "🚀 NEWS: ",
5
- "news_banner_link": "World's First Multi-Image Editing Tool ",
6
  "global_editor_tab": "🌍 Global Editor",
7
  "upload_image_header": "### 📸 Upload Image",
8
  "upload_image_label": "Select image to edit",
 
2
  "app_title": "AI Image Editor",
3
  "header_title": "🎨 AI Image Editor",
4
  "news_banner_prefix": "🚀 NEWS: ",
5
+ "news_banner_link": "Text-to-Image Is Live — The Best Human Generation Yet!",
6
  "global_editor_tab": "🌍 Global Editor",
7
  "upload_image_header": "### 📸 Upload Image",
8
  "upload_image_label": "Select image to edit",
i18n/es.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "Editor de Imágenes con IA",
3
  "header_title": "🎨 Editor de Imágenes con IA",
4
  "news_banner_prefix": "🚀 Noticias: ",
5
- "news_banner_link": "La primera herramienta de edición de múltiples imágenes del mundo ",
6
  "global_editor_tab": "🌍 Edición Global",
7
  "upload_image_header": "### 📸 Subir Imagen",
8
  "upload_image_label": "Selecciona una imagen para editar",
 
2
  "app_title": "Editor de Imágenes con IA",
3
  "header_title": "🎨 Editor de Imágenes con IA",
4
  "news_banner_prefix": "🚀 Noticias: ",
5
+ "news_banner_link": "¡Text-to-Image ya está disponible la mejor generación humana hasta ahora!",
6
  "global_editor_tab": "🌍 Edición Global",
7
  "upload_image_header": "### 📸 Subir Imagen",
8
  "upload_image_label": "Selecciona una imagen para editar",
i18n/fi.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "AI-kuvaeditori",
3
  "header_title": "🎨 AI-kuvaeditori",
4
  "news_banner_prefix": "🚀 Uutisia: ",
5
- "news_banner_link": "Maailman ensimmäinen usean kuvan muokkaustyökalu ",
6
  "global_editor_tab": "🌍 Globaali muokkaus",
7
  "upload_image_header": "### 📸 Lataa kuva",
8
  "upload_image_label": "Valitse muokattava kuva",
 
2
  "app_title": "AI-kuvaeditori",
3
  "header_title": "🎨 AI-kuvaeditori",
4
  "news_banner_prefix": "🚀 Uutisia: ",
5
+ "news_banner_link": "Text-to-Image on nyt julkaistu paras ihmismallimme koskaan!",
6
  "global_editor_tab": "🌍 Globaali muokkaus",
7
  "upload_image_header": "### 📸 Lataa kuva",
8
  "upload_image_label": "Valitse muokattava kuva",
i18n/fr.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "Éditeur d'Images IA",
3
  "header_title": "🎨 Éditeur d'Images IA",
4
  "news_banner_prefix": "🚀 Actualités : ",
5
- "news_banner_link": "Le premier outil de retouche multi-images au monde ",
6
  "global_editor_tab": "🌍 Édition Globale",
7
  "upload_image_header": "### 📸 Télécharger une image",
8
  "upload_image_label": "Sélectionnez une image à modifier",
 
2
  "app_title": "Éditeur d'Images IA",
3
  "header_title": "🎨 Éditeur d'Images IA",
4
  "news_banner_prefix": "🚀 Actualités : ",
5
+ "news_banner_link": "Text-to-Image est disponible La meilleure génération humaine à ce jour !",
6
  "global_editor_tab": "🌍 Édition Globale",
7
  "upload_image_header": "### 📸 Télécharger une image",
8
  "upload_image_label": "Sélectionnez une image à modifier",
i18n/he.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "עורך תמונות AI",
3
  "header_title": "🎨 עורך תמונות AI",
4
  "news_banner_prefix": "🚀 חדשות: ",
5
- "news_banner_link": "הכלי הראשון בעולם לעריכת תמונות מרובות ",
6
  "global_editor_tab": "🌍 עריכה גלובלית",
7
  "upload_image_header": "### 📸 העלאת תמונה",
8
  "upload_image_label": "בחר תמונה לעריכה",
 
2
  "app_title": "עורך תמונות AI",
3
  "header_title": "🎨 עורך תמונות AI",
4
  "news_banner_prefix": "🚀 חדשות: ",
5
+ "news_banner_link": "Text-to-Image זמין עכשיו הדור האנושי הטוב ביותר אי פעם!",
6
  "global_editor_tab": "🌍 עריכה גלובלית",
7
  "upload_image_header": "### 📸 העלאת תמונה",
8
  "upload_image_label": "בחר תמונה לעריכה",
i18n/id.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "Editor Gambar AI",
3
  "header_title": "🎨 Editor Gambar AI",
4
  "news_banner_prefix": "🚀 Berita: ",
5
- "news_banner_link": "Alat edit multi-gambar pertama di dunia ",
6
  "global_editor_tab": "🌍 Pengeditan Global",
7
  "upload_image_header": "### 📸 Unggah Gambar",
8
  "upload_image_label": "Pilih gambar untuk diedit",
 
2
  "app_title": "Editor Gambar AI",
3
  "header_title": "🎨 Editor Gambar AI",
4
  "news_banner_prefix": "🚀 Berita: ",
5
+ "news_banner_link": "Text-to-Image sudah tersedia Generasi manusia terbaik yang pernah ada!",
6
  "global_editor_tab": "🌍 Pengeditan Global",
7
  "upload_image_header": "### 📸 Unggah Gambar",
8
  "upload_image_label": "Pilih gambar untuk diedit",
i18n/it.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "Editor di Immagini AI",
3
  "header_title": "🎨 Editor di Immagini AI",
4
  "news_banner_prefix": "🚀 Notizie: ",
5
- "news_banner_link": "Il primo strumento di modifica multi-immagine al mondo ",
6
  "global_editor_tab": "🌍 Modifica Globale",
7
  "upload_image_header": "### 📸 Carica Immagine",
8
  "upload_image_label": "Seleziona un'immagine da modificare",
 
2
  "app_title": "Editor di Immagini AI",
3
  "header_title": "🎨 Editor di Immagini AI",
4
  "news_banner_prefix": "🚀 Notizie: ",
5
+ "news_banner_link": "Text-to-Image è disponibile La migliore generazione umana di sempre!",
6
  "global_editor_tab": "🌍 Modifica Globale",
7
  "upload_image_header": "### 📸 Carica Immagine",
8
  "upload_image_label": "Seleziona un'immagine da modificare",
i18n/ja.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "AI画像エディター",
3
  "header_title": "🎨 AI画像エディター",
4
  "news_banner_prefix": "🚀 ニュース: ",
5
- "news_banner_link": "世界初のマルチ画像編集ツール ",
6
  "global_editor_tab": "🌍 全体編集",
7
  "upload_image_header": "### 📸 画像をアップロード",
8
  "upload_image_label": "編集する画像を選択",
 
2
  "app_title": "AI画像エディター",
3
  "header_title": "🎨 AI画像エディター",
4
  "news_banner_prefix": "🚀 ニュース: ",
5
+ "news_banner_link": "Text-to-Imageがリリース — 史上最高の人物生成!",
6
  "global_editor_tab": "🌍 全体編集",
7
  "upload_image_header": "### 📸 画像をアップロード",
8
  "upload_image_label": "編集する画像を選択",
i18n/nl.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "AI-beeld-editor",
3
  "header_title": "🎨 AI-beeld-editor",
4
  "news_banner_prefix": "🚀 Nieuws: ",
5
- "news_banner_link": "De eerste multi-beeld-bewerkingstool ter wereld →",
6
  "global_editor_tab": "🌍 Algemene Bewerking",
7
  "upload_image_header": "### 📸 Afbeelding uploaden",
8
  "upload_image_label": "Selecteer een afbeelding om te bewerken",
 
2
  "app_title": "AI-beeld-editor",
3
  "header_title": "🎨 AI-beeld-editor",
4
  "news_banner_prefix": "🚀 Nieuws: ",
5
+ "news_banner_link": "Text-to-Image is live — De beste menselijke generatie ooit!",
6
  "global_editor_tab": "🌍 Algemene Bewerking",
7
  "upload_image_header": "### 📸 Afbeelding uploaden",
8
  "upload_image_label": "Selecteer een afbeelding om te bewerken",
i18n/no.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "AI-bilderedigering",
3
  "header_title": "🎨 AI-bilderedigering",
4
  "news_banner_prefix": "🚀 Nyheter: ",
5
- "news_banner_link": "Verdens første redigeringsverktøy for flere bilder ",
6
  "global_editor_tab": "🌍 Global redigering",
7
  "upload_image_header": "### 📸 Last opp bilde",
8
  "upload_image_label": "Velg et bilde du vil redigere",
 
2
  "app_title": "AI-bilderedigering",
3
  "header_title": "🎨 AI-bilderedigering",
4
  "news_banner_prefix": "🚀 Nyheter: ",
5
+ "news_banner_link": "Text-to-Image er live Den beste menneskelige genereringen noensinne!",
6
  "global_editor_tab": "🌍 Global redigering",
7
  "upload_image_header": "### 📸 Last opp bilde",
8
  "upload_image_label": "Velg et bilde du vil redigere",
i18n/pt.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "Editor de Imagens com IA",
3
  "header_title": "🎨 Editor de Imagens com IA",
4
  "news_banner_prefix": "🚀 Notícias: ",
5
- "news_banner_link": "A primeira ferramenta de edição de múltiplas imagens do mundo ",
6
  "global_editor_tab": "🌍 Edição Global",
7
  "upload_image_header": "### 📸 Carregar Imagem",
8
  "upload_image_label": "Selecione uma imagem para editar",
 
2
  "app_title": "Editor de Imagens com IA",
3
  "header_title": "🎨 Editor de Imagens com IA",
4
  "news_banner_prefix": "🚀 Notícias: ",
5
+ "news_banner_link": "Text-to-Image está no ar o melhor modelo humano até agora!",
6
  "global_editor_tab": "🌍 Edição Global",
7
  "upload_image_header": "### 📸 Carregar Imagem",
8
  "upload_image_label": "Selecione uma imagem para editar",
i18n/ru.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "Редактор изображений с ИИ",
3
  "header_title": "🎨 Редактор изображений с ИИ",
4
  "news_banner_prefix": "🚀 Новости: ",
5
- "news_banner_link": "Первый в мире инструмент для редактирования нескольких изображений ",
6
  "global_editor_tab": "🌍 Глобальное редактирование",
7
  "upload_image_header": "### 📸 Загрузить изображение",
8
  "upload_image_label": "Выберите изображение для редактирования",
 
2
  "app_title": "Редактор изображений с ИИ",
3
  "header_title": "🎨 Редактор изображений с ИИ",
4
  "news_banner_prefix": "🚀 Новости: ",
5
+ "news_banner_link": "Text-to-Image уже доступен Лучшая генерация людей за всю историю!",
6
  "global_editor_tab": "🌍 Глобальное редактирование",
7
  "upload_image_header": "### 📸 Загрузить изображение",
8
  "upload_image_label": "Выберите изображение для редактирования",
i18n/sv.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "AI-bildredigerare",
3
  "header_title": "🎨 AI-bildredigerare",
4
  "news_banner_prefix": "🚀 Nyheter: ",
5
- "news_banner_link": "Världens första redigeringsverktyg för flera bilder ",
6
  "global_editor_tab": "🌍 Global redigering",
7
  "upload_image_header": "### 📸 Ladda upp bild",
8
  "upload_image_label": "Välj en bild att redigera",
 
2
  "app_title": "AI-bildredigerare",
3
  "header_title": "🎨 AI-bildredigerare",
4
  "news_banner_prefix": "🚀 Nyheter: ",
5
+ "news_banner_link": "Text-to-Image är live Den bästa mänskliga genereringen någonsin!",
6
  "global_editor_tab": "🌍 Global redigering",
7
  "upload_image_header": "### 📸 Ladda upp bild",
8
  "upload_image_label": "Välj en bild att redigera",
i18n/tr.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "Yapay Zeka Resim Düzenleyici",
3
  "header_title": "🎨 Yapay Zeka Resim Düzenleyici",
4
  "news_banner_prefix": "🚀 Haberler: ",
5
- "news_banner_link": "Dünyanın ilk çoklu resim düzenleme aracı ",
6
  "global_editor_tab": "🌍 Genel Düzenleme",
7
  "upload_image_header": "### 📸 Resim Yükle",
8
  "upload_image_label": "Düzenlemek için bir resim seçin",
 
2
  "app_title": "Yapay Zeka Resim Düzenleyici",
3
  "header_title": "🎨 Yapay Zeka Resim Düzenleyici",
4
  "news_banner_prefix": "🚀 Haberler: ",
5
+ "news_banner_link": "Text-to-Image yayında Şimdiye kadarki en iyi insan üretimi!",
6
  "global_editor_tab": "🌍 Genel Düzenleme",
7
  "upload_image_header": "### 📸 Resim Yükle",
8
  "upload_image_label": "Düzenlemek için bir resim seçin",
i18n/uk.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "Редактор зображень зі ШІ",
3
  "header_title": "🎨 Редактор зображень зі ШІ",
4
  "news_banner_prefix": "🚀 Новини: ",
5
- "news_banner_link": "Перший у світі інструмент для редагування кількох зображень ",
6
  "global_editor_tab": "🌍 Глобальне редагування",
7
  "upload_image_header": "### 📸 Завантажити зображення",
8
  "upload_image_label": "Виберіть зображення для редагування",
 
2
  "app_title": "Редактор зображень зі ШІ",
3
  "header_title": "🎨 Редактор зображень зі ШІ",
4
  "news_banner_prefix": "🚀 Новини: ",
5
+ "news_banner_link": "Text-to-Image вже доступний Найкраща генерація людей за весь час!",
6
  "global_editor_tab": "🌍 Глобальне редагування",
7
  "upload_image_header": "### 📸 Завантажити зображення",
8
  "upload_image_label": "Виберіть зображення для редагування",
i18n/vi.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "Trình chỉnh sửa ảnh AI",
3
  "header_title": "🎨 Trình chỉnh sửa ảnh AI",
4
  "news_banner_prefix": "🚀 Tin tức: ",
5
- "news_banner_link": "Công cụ chỉnh sửa nhiều ảnh đầu tiên trên thế giới ",
6
  "global_editor_tab": "🌍 Chỉnh sửa toàn cục",
7
  "upload_image_header": "### 📸 Tải ảnh lên",
8
  "upload_image_label": "Chọn một ảnh để chỉnh sửa",
 
2
  "app_title": "Trình chỉnh sửa ảnh AI",
3
  "header_title": "🎨 Trình chỉnh sửa ảnh AI",
4
  "news_banner_prefix": "🚀 Tin tức: ",
5
+ "news_banner_link": "Text-to-Image đã ra mắt Tạo người tốt nhất từ trước đến nay!",
6
  "global_editor_tab": "🌍 Chỉnh sửa toàn cục",
7
  "upload_image_header": "### 📸 Tải ảnh lên",
8
  "upload_image_label": "Chọn một ảnh để chỉnh sửa",
i18n/zh.json CHANGED
@@ -2,7 +2,7 @@
2
  "app_title": "AI 图像编辑器",
3
  "header_title": "🎨 AI 图像编辑器",
4
  "news_banner_prefix": "🚀 新闻: ",
5
- "news_banner_link": "全球首款多图像编辑工具 ",
6
  "global_editor_tab": "🌍 全局编辑",
7
  "upload_image_header": "### 📸 上传图片",
8
  "upload_image_label": "选择要编辑的图片",
 
2
  "app_title": "AI 图像编辑器",
3
  "header_title": "🎨 AI 图像编辑器",
4
  "news_banner_prefix": "🚀 新闻: ",
5
+ "news_banner_link": "文本生成图像上线啦 —— 史上最强人体生成模型!→",
6
  "global_editor_tab": "🌍 全局编辑",
7
  "upload_image_header": "### 📸 上传图片",
8
  "upload_image_label": "选择要编辑的图片",
util.py CHANGED
@@ -257,9 +257,12 @@ def upload_mask_image_r2(client_ip, time_id, mask_image):
257
 
258
 
259
 
260
- def submit_image_edit_task(user_image_url, prompt, task_type="80", mask_image_url="", reference_image_url=""):
261
  """
262
  Submit image editing task with improved error handling using API v2
 
 
 
263
  """
264
  headers = {
265
  'Content-Type': 'application/json',
@@ -272,7 +275,7 @@ def submit_image_edit_task(user_image_url, prompt, task_type="80", mask_image_ur
272
  "type": task_type,
273
  "text": prompt,
274
  "user_uuid": APIKEY,
275
- "priority": 0,
276
  "secret_key": "219ngu"
277
  }
278
 
@@ -390,7 +393,7 @@ def check_task_status(task_id):
390
  return 'error', None, f"Failed after {max_retries} retries"
391
 
392
 
393
- def process_image_edit(img_input, prompt, reference_image=None, progress_callback=None):
394
  """
395
  Complete process for image editing
396
 
@@ -398,6 +401,7 @@ def process_image_edit(img_input, prompt, reference_image=None, progress_callbac
398
  img_input: Can be file path (str) or PIL Image object
399
  prompt: Editing instructions
400
  progress_callback: Progress callback function
 
401
  """
402
  try:
403
  # Generate client IP and timestamp
@@ -449,7 +453,7 @@ def process_image_edit(img_input, prompt, reference_image=None, progress_callbac
449
  return None, None, f"reference image processing failed: {str(e)}", None
450
 
451
  # Submit image editing task
452
- task_id, error = submit_image_edit_task(uploaded_url, prompt, reference_image_url=reference_url)
453
  if error:
454
  return None, None, error, None
455
 
@@ -505,7 +509,7 @@ def process_image_edit(img_input, prompt, reference_image=None, progress_callbac
505
  return None, None, f"error occurred during processing: {str(e)}", None
506
 
507
 
508
- def process_local_image_edit(base_image, layers, prompt, reference_image=None, progress_callback=None, use_example_mask=None):
509
  """
510
  处理局部图片编辑的完整流程
511
 
@@ -514,6 +518,7 @@ def process_local_image_edit(base_image, layers, prompt, reference_image=None, p
514
  layers (list): ImageEditor的层数据
515
  prompt (str): 编辑指令
516
  progress_callback: 进度回调函数
 
517
  """
518
  try:
519
  # Generate client IP and timestamp
@@ -627,7 +632,8 @@ def process_local_image_edit(base_image, layers, prompt, reference_image=None, p
627
  prompt,
628
  task_type="81",
629
  mask_image_url=mask_url,
630
- reference_image_url=reference_url
 
631
  )
632
  if error:
633
  return None, None, error, None
 
257
 
258
 
259
 
260
+ def submit_image_edit_task(user_image_url, prompt, task_type="80", mask_image_url="", reference_image_url="", priority=0):
261
  """
262
  Submit image editing task with improved error handling using API v2
263
+
264
+ Args:
265
+ priority (int): Task priority, 1 for high priority, 0 for normal priority
266
  """
267
  headers = {
268
  'Content-Type': 'application/json',
 
275
  "type": task_type,
276
  "text": prompt,
277
  "user_uuid": APIKEY,
278
+ "priority": priority,
279
  "secret_key": "219ngu"
280
  }
281
 
 
393
  return 'error', None, f"Failed after {max_retries} retries"
394
 
395
 
396
+ def process_image_edit(img_input, prompt, reference_image=None, progress_callback=None, priority=0):
397
  """
398
  Complete process for image editing
399
 
 
401
  img_input: Can be file path (str) or PIL Image object
402
  prompt: Editing instructions
403
  progress_callback: Progress callback function
404
+ priority (int): Task priority, 1 for high priority, 0 for normal priority
405
  """
406
  try:
407
  # Generate client IP and timestamp
 
453
  return None, None, f"reference image processing failed: {str(e)}", None
454
 
455
  # Submit image editing task
456
+ task_id, error = submit_image_edit_task(uploaded_url, prompt, reference_image_url=reference_url, priority=priority)
457
  if error:
458
  return None, None, error, None
459
 
 
509
  return None, None, f"error occurred during processing: {str(e)}", None
510
 
511
 
512
+ def process_local_image_edit(base_image, layers, prompt, reference_image=None, progress_callback=None, use_example_mask=None, priority=0):
513
  """
514
  处理局部图片编辑的完整流程
515
 
 
518
  layers (list): ImageEditor的层数据
519
  prompt (str): 编辑指令
520
  progress_callback: 进度回调函数
521
+ priority (int): Task priority, 1 for high priority, 0 for normal priority
522
  """
523
  try:
524
  # Generate client IP and timestamp
 
632
  prompt,
633
  task_type="81",
634
  mask_image_url=mask_url,
635
+ reference_image_url=reference_url,
636
+ priority=priority
637
  )
638
  if error:
639
  return None, None, error, None