pygpt-net 2.7.2__py3-none-any.whl → 2.7.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pygpt_net/CHANGELOG.txt CHANGED
@@ -1,3 +1,7 @@
1
+ 2.7.3 (2025-12-30)
2
+
3
+ - Added the `Remix/Extend` option in Image and Video generation mode. This allows the use of a previously generated image or video as a reference. It can be used for adding or changing elements in a previously generated image or video instead of creating a new one from scratch. See the docs: `Modes -> Image and Video generation -> Remix, Edit, or Extend`.
4
+
1
5
  2.7.2 (2025-12-29)
2
6
 
3
7
  - Fixed: non-searchable combobox width.
pygpt_net/__init__.py CHANGED
@@ -6,15 +6,15 @@
6
6
  # GitHub: https://github.com/szczyglis-dev/py-gpt #
7
7
  # MIT License #
8
8
  # Created By : Marcin Szczygliński #
9
- # Updated Date: 2025.12.29 00:00:00 #
9
+ # Updated Date: 2025.12.30 00:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  __author__ = "Marcin Szczygliński"
13
13
  __copyright__ = "Copyright 2025, Marcin Szczygliński"
14
14
  __credits__ = ["Marcin Szczygliński"]
15
15
  __license__ = "MIT"
16
- __version__ = "2.7.2"
17
- __build__ = "2025-12-29"
16
+ __version__ = "2.7.3"
17
+ __build__ = "2025-12-30"
18
18
  __maintainer__ = "Marcin Szczygliński"
19
19
  __github__ = "https://github.com/szczyglis-dev/py-gpt"
20
20
  __report__ = "https://github.com/szczyglis-dev/py-gpt/issues"
@@ -6,7 +6,7 @@
6
6
  # GitHub: https://github.com/szczyglis-dev/py-gpt #
7
7
  # MIT License #
8
8
  # Created By : Marcin Szczygliński #
9
- # Updated Date: 2025.09.07 05:00:00 #
9
+ # Updated Date: 2025.12.30 22:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import os
@@ -47,7 +47,7 @@ class Image:
47
47
  update_status = self.window.update_status
48
48
  dispatch = self.window.dispatch
49
49
 
50
- num = int(self.window.ui.config['global']['img_variants'].input.text() or 1)
50
+ num = int(self.window.ui.config['global']['img_variants'].text() or 1)
51
51
  if num < 1:
52
52
  num = 1
53
53
  elif num > 4:
@@ -57,7 +57,8 @@ class Image:
57
57
  mode = core.config.get('mode')
58
58
  model = core.config.get('model')
59
59
  model_data = core.models.get(model)
60
- if model_data.id == 'dall-e-3' or model_data.id == 'gpt-image-1':
60
+ if (model_data and model_data.id
61
+ and (model_data.id == 'dall-e-3' or model_data.id.startswith('gpt-image-1'))):
61
62
  num = 1
62
63
 
63
64
  update_status(trans('status.sending'))
@@ -70,6 +71,26 @@ class Image:
70
71
  ctx.prev_ctx = prev_ctx # store previous context item
71
72
  ctx.live = True
72
73
 
74
+ # prepare previous image_id and video_id from last context (for variations)
75
+ image_id = None
76
+ video_id = None
77
+
78
+ if core.config.get("video.remix") or core.config.get("img.remix"):
79
+ items = core.ctx.get_items()
80
+ reversed_items = reversed(items)
81
+ for item in reversed_items:
82
+ if isinstance(item.extra, dict):
83
+ if core.config.get("video.remix"):
84
+ tmp_video_id = item.extra.get('video_id')
85
+ if video_id is None and tmp_video_id:
86
+ video_id = tmp_video_id
87
+ if core.config.get("img.remix"):
88
+ tmp_image_id = item.extra.get('image_id')
89
+ if image_id is None and tmp_image_id:
90
+ image_id = tmp_image_id
91
+ if image_id and video_id:
92
+ break
93
+
73
94
  # event: context before
74
95
  event = Event(Event.CTX_BEFORE)
75
96
  event.ctx = ctx
@@ -117,6 +138,8 @@ class Image:
117
138
  'context': context,
118
139
  'extra': {
119
140
  "num": num,
141
+ "image_id": image_id, # pass previous image_id for variations
142
+ "video_id": video_id, # pass previous video_id for variations
120
143
  },
121
144
  }))
122
145
  except Exception as e:
@@ -6,7 +6,7 @@
6
6
  # GitHub: https://github.com/szczyglis-dev/py-gpt #
7
7
  # MIT License #
8
8
  # Created By : Marcin Szczygliński #
9
- # Updated Date: 2025.12.26 12:00:00 #
9
+ # Updated Date: 2025.12.30 22:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from typing import Any
@@ -30,6 +30,34 @@ class Media:
30
30
  else:
31
31
  self.window.ui.config['global']['img_raw'].setChecked(False)
32
32
 
33
+ # remix for images
34
+ if self.window.core.config.get('img.remix'):
35
+ self.window.ui.config['global']['img.remix'].setChecked(True)
36
+ else:
37
+ self.window.ui.config['global']['img.remix'].setChecked(False)
38
+
39
+ # remix for video
40
+ if self.window.core.config.get('video.remix'):
41
+ self.window.ui.config['global']['video.remix'].setChecked(True)
42
+ else:
43
+ self.window.ui.config['global']['video.remix'].setChecked(False)
44
+
45
+ # img variants
46
+ opt_variants = {
47
+ "type": "int",
48
+ "label": "img_variants",
49
+ "min": 1,
50
+ "max": 4,
51
+ "value": 1,
52
+ }
53
+ variants = self.window.core.config.get('img_variants', 1)
54
+ self.window.controller.config.apply_value(
55
+ parent_id="global",
56
+ key="img_variants",
57
+ option=opt_variants,
58
+ value=variants,
59
+ )
60
+
33
61
  # mode (image|video|music)
34
62
  mode = self.window.core.config.get('img_mode', 'image')
35
63
  self.window.controller.config.apply_value(
@@ -79,6 +107,7 @@ class Media:
79
107
  if not self.initialized:
80
108
  self.window.ui.add_hook("update.global.img_resolution", self.hook_update)
81
109
  self.window.ui.add_hook("update.global.img_mode", self.hook_update)
110
+ self.window.ui.add_hook("update.global.img_variants", self.hook_update)
82
111
  self.window.ui.add_hook("update.global.video.aspect_ratio", self.hook_update)
83
112
  self.window.ui.add_hook("update.global.video.resolution", self.hook_update)
84
113
  self.window.ui.add_hook("update.global.video.duration", self.hook_update)
@@ -99,6 +128,10 @@ class Media:
99
128
  if not value:
100
129
  return
101
130
  self.window.core.config.set('img_resolution', value)
131
+ elif key == "img_variants":
132
+ if not value:
133
+ return
134
+ self.window.core.config.set('img_variants', int(value))
102
135
  elif key == "img_mode":
103
136
  if not value:
104
137
  return
@@ -135,6 +168,42 @@ class Media:
135
168
  else:
136
169
  self.enable_raw()
137
170
 
171
+ def enable_remix_image(self):
172
+ """Enable remix for image"""
173
+ self.window.core.config.set('img.remix', True)
174
+ self.window.core.config.save()
175
+
176
+ def disable_remix_image(self):
177
+ """Disable remix for image"""
178
+ self.window.core.config.set('img.remix', False)
179
+ self.window.core.config.save()
180
+
181
+ def toggle_remix_image(self):
182
+ """Save remix enabled option for image"""
183
+ state = self.window.ui.config['global']['img.remix'].isChecked()
184
+ if not state:
185
+ self.disable_remix_image()
186
+ else:
187
+ self.enable_remix_image()
188
+
189
+ def enable_remix_video(self):
190
+ """Enable remix for video"""
191
+ self.window.core.config.set('video.remix', True)
192
+ self.window.core.config.save()
193
+
194
+ def disable_remix_video(self):
195
+ """Disable remix for video"""
196
+ self.window.core.config.set('video.remix', False)
197
+ self.window.core.config.save()
198
+
199
+ def toggle_remix_video(self):
200
+ """Save remix enabled option for video"""
201
+ state = self.window.ui.config['global']['video.remix'].isChecked()
202
+ if not state:
203
+ self.disable_remix_video()
204
+ else:
205
+ self.enable_remix_video()
206
+
138
207
  def get_mode(self) -> str:
139
208
  """Get media generation mode (image/video/music)"""
140
209
  return self.window.core.config.get("img_mode", "image")
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "__meta__": {
3
- "version": "2.7.2",
4
- "app.version": "2.7.2",
5
- "updated_at": "2025-12-29T00:00:00"
3
+ "version": "2.7.3",
4
+ "app.version": "2.7.3",
5
+ "updated_at": "2025-12-30T00:00:00"
6
6
  },
7
7
  "access.audio.event.speech": false,
8
8
  "access.audio.event.speech.disabled": [],
@@ -213,6 +213,7 @@
213
213
  "img_resolution": "1024x1024",
214
214
  "img_quality": "standard",
215
215
  "img_variants": 1,
216
+ "img.remix": false,
216
217
  "interpreter.auto_clear": false,
217
218
  "interpreter.execute_all": false,
218
219
  "interpreter.edit": false,
@@ -542,6 +543,7 @@
542
543
  "video.player.volume": 100,
543
544
  "video.player.volume.mute": false,
544
545
  "video.prompt_model": "gemini-2.5-flash",
546
+ "video.remix": false,
545
547
  "video.resolution": "720p",
546
548
  "video.seed": "",
547
549
  "vision.capture.auto": false,
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "__meta__": {
3
- "version": "2.7.2",
4
- "app.version": "2.7.2",
5
- "updated_at": "2025-12-29T00:00:00"
3
+ "version": "2.7.3",
4
+ "app.version": "2.7.3",
5
+ "updated_at": "2025-12-30T00:00:00"
6
6
  },
7
7
  "items": {
8
8
  "SpeakLeash/bielik-11b-v2.3-instruct:Q4_K_M": {
@@ -748,6 +748,8 @@ idx.token.warn = Dies wird zusätzliche Token für das Einbetten der Daten verbr
748
748
  img.action.open = In voller Größe öffnen
749
749
  img.action.save = Speichern unter...
750
750
  img.raw = Raw-Modus
751
+ img.remix = Remixen/Erweitern
752
+ img.remix.tooltip = Remixen/Erweitern vom vorherigen Bild im Kontext aktivieren.\nFalls aktiviert, wird das vorherige Bild als Referenz verwendet, anstatt ein neues von Grund auf zu erstellen.
751
753
  img.save.title = Bild speichern
752
754
  img.status.downloading = Herunterladen...
753
755
  img.status.error = Fehler bei der Bildgenerierung
@@ -1677,6 +1679,8 @@ updater.check.launch = Beim Start prüfen
1677
1679
  update.released = Build
1678
1680
  update.snap = Zum Snap Store gehen
1679
1681
  update.title = Nach Updates suchen
1682
+ video.remix = Remixen/Erweitern
1683
+ video.remix.tooltip = Remixen/Erweitern vom vorherigen Video im Kontext aktivieren (Sora2, Veo3.1).\nFalls aktiviert, wird das vorherige Video als Referenz verwendet, anstatt ein neues von Grund auf zu erstellen.
1680
1684
  vid.status.downloading = Video wird heruntergeladen... bitte warten...
1681
1685
  vid.status.generating = Video wird generiert von
1682
1686
  vid.status.prompt.error = Fehler bei der Verbesserungsaufforderung
@@ -762,6 +762,8 @@ idx.token.warn = This will consume additional tokens to embed the data.
762
762
  img.action.open = Open full size
763
763
  img.action.save = Save As...
764
764
  img.raw = Raw mode
765
+ img.remix = Remix/Extend
766
+ img.remix.tooltip = Enable remix/extend from the previous image in context.\nIf enabled, the previous image will be used as a reference instead of creating a new one from scratch.
765
767
  img.save.title = Save image
766
768
  img.status.downloading = Downloading...
767
769
  img.status.error = Image generation error
@@ -1758,6 +1760,8 @@ updater.check.launch = Check on launch
1758
1760
  update.released = build
1759
1761
  update.snap = Go to Snap Store
1760
1762
  update.title = Check for updates
1763
+ video.remix = Remix/Extend
1764
+ video.remix.tooltip = Enable remix/extend from the previous video in context (Sora2, Veo3.1).\nIf enabled, the previous video will be used as a reference instead of creating a new one from scratch.
1761
1765
  vid.status.downloading = Downloading video... please wait...
1762
1766
  vid.status.generating = Generating video from
1763
1767
  vid.status.prompt.error = Enhancement prompt error occured
@@ -749,6 +749,8 @@ idx.token.warn = Esto consumirá tokens adicionales para incrustar los datos.
749
749
  img.action.open = Abrir tamaño completo
750
750
  img.action.save = Guardar como...
751
751
  img.raw = Modo raw
752
+ img.remix = Remix/Extender
753
+ img.remix.tooltip = Habilitar remix/extensión de la imagen anterior en el contexto.\nSi está habilitado, la imagen anterior se usará como referencia en lugar de crear una nueva desde cero.
752
754
  img.save.title = Guardar imagen
753
755
  img.status.downloading = Descargando...
754
756
  img.status.error = Error al generar la imagen
@@ -1678,6 +1680,8 @@ updater.check.launch = Comprobar al iniciar
1678
1680
  update.released = Versión
1679
1681
  update.snap = Ir a Snap Store
1680
1682
  update.title = Buscando actualizaciones
1683
+ video.remix = Remix/Extender
1684
+ video.remix.tooltip = Habilitar remix/extensión del video anterior en el contexto (Sora2, Veo3.1).\nSi está habilitado, el video anterior se usará como referencia en lugar de crear uno nuevo desde cero.
1681
1685
  vid.status.downloading = Descargando video... por favor espere...
1682
1686
  vid.status.generating = Generando video desde
1683
1687
  vid.status.prompt.error = Ocurrió un error en la indicación de mejora
@@ -748,6 +748,8 @@ idx.token.warn = Cela consommera des jetons supplémentaires pour l'encastrement
748
748
  img.action.open = Ouvrir en taille réelle
749
749
  img.action.save = Enregistrer sous...
750
750
  img.raw = Mode brut
751
+ img.remix = Remixer/Étendre
752
+ img.remix.tooltip = Activer le remixage/étendre à partir de l'image précédente dans le contexte.\nSi activé, l'image précédente sera utilisée comme référence au lieu de créer une nouvelle à partir de zéro.
751
753
  img.save.title = Enregistrer l'image
752
754
  img.status.downloading = Téléchargement en cours...
753
755
  img.status.error = Erreur de génération d'image
@@ -1677,6 +1679,8 @@ updater.check.launch = Vérifier au démarrage
1677
1679
  update.released = build
1678
1680
  update.snap = Aller au Snap Store
1679
1681
  update.title = Vérification des mises à jour
1682
+ video.remix = Remixer/Étendre
1683
+ video.remix.tooltip = Activer le remixage/étendre à partir de la vidéo précédente dans le contexte (Sora2, Veo3.1).\nSi activé, la vidéo précédente sera utilisée comme référence au lieu de créer une nouvelle à partir de zéro.
1680
1684
  vid.status.downloading = Téléchargement de la vidéo... veuillez patienter...
1681
1685
  vid.status.generating = Génération de la vidéo à partir de
1682
1686
  vid.status.prompt.error = Erreur d'amélioration de l'invite survenue
@@ -748,6 +748,8 @@ idx.token.warn = Questo consumerà token aggiuntivi per incorporare i dati.
748
748
  img.action.open = Apri a piena dimensione
749
749
  img.action.save = Salva come...
750
750
  img.raw = Modalità grezza
751
+ img.remix = Remix/Estendi
752
+ img.remix.tooltip = Abilita remix/estensione dall'immagine precedente nel contesto.\nSe abilitato, l'immagine precedente sarà utilizzata come riferimento invece di crearne una nuova da zero.
751
753
  img.save.title = Salva immagine
752
754
  img.status.downloading = Scaricamento in corso...
753
755
  img.status.error = Errore nella generazione dell'immagine
@@ -1677,6 +1679,8 @@ updater.check.launch = Controlla all'avvio
1677
1679
  update.released = build
1678
1680
  update.snap = Vai allo Snap Store
1679
1681
  update.title = Controllo degli aggiornamenti
1682
+ video.remix = Remix/Estendi
1683
+ video.remix.tooltip = Abilita remix/estensione dal video precedente nel contesto (Sora2, Veo3.1).\nSe abilitato, il video precedente sarà utilizzato come riferimento invece di crearne uno nuovo da zero.
1680
1684
  vid.status.downloading = Download del video... si prega di attendere...
1681
1685
  vid.status.generating = Generazione video da
1682
1686
  vid.status.prompt.error = Si è verificato un errore nel prompt di miglioramento
@@ -38,7 +38,7 @@ action.open_dir_src = Otwórz katalog źródłowy
38
38
  action.open_dir_storage = Otwórz katalog magazynowy
39
39
  action.open_new_tab = Otwórz w nowej karcie
40
40
  action.open_new_window = Otwórz (w nowym oknie)
41
- action.pack = Spakuj
41
+ action.pack = Spakuj
42
42
  action.paste = Wklej
43
43
  action.pin = Przypnij na górze
44
44
  action.preview = Podgląd
@@ -749,6 +749,8 @@ idx.token.warn = Spowoduje to użycie dodatkowych tokenów w celu osadzenia dany
749
749
  img.action.open = Otwórz pełny rozmiar
750
750
  img.action.save = Zapisz jako...
751
751
  img.raw = Tryb raw
752
+ img.remix = Remiks/Rozszerz
753
+ img.remix.tooltip = Umożliwiaj remiks/rozszerzenie z poprzedniego obrazu w kontekście.\nJeśli włączone, poprzedni obraz będzie używany jako odniesienie zamiast tworzenia nowego od zera.
752
754
  img.save.title = Zapisz obraz
753
755
  img.status.downloading = Pobieranie obrazu...
754
756
  img.status.error = Błąd generowania obrazu
@@ -1678,6 +1680,8 @@ updater.check.launch = Sprawdzaj przy uruchamianiu
1678
1680
  update.released = wydanie
1679
1681
  update.snap = Pobierz ze Snap Store
1680
1682
  update.title = Sprawdzanie dostępności aktualizacji
1683
+ video.remix = Remiks/Rozszerz
1684
+ video.remix.tooltip = Umożliwiaj remiks/rozszerzenie z poprzedniego wideo w kontekście (Sora2, Veo3.1).\nJeśli włączone, poprzednie wideo będzie używane jako odniesienie zamiast tworzenia nowego od zera.
1681
1685
  vid.status.downloading = Downloading video... please wait...
1682
1686
  vid.status.generating = Generating video from
1683
1687
  vid.status.prompt.error = Enhancement prompt error occured
@@ -748,6 +748,8 @@ idx.token.warn = Це призведе до використання додат
748
748
  img.action.open = Відкрити повний розмір
749
749
  img.action.save = Зберегти як...
750
750
  img.raw = Режим сирця
751
+ img.remix = Ремікс/Розширити
752
+ img.remix.tooltip = Увімкнути ремікс/розширення з попереднього зображення у контексті.\nЯкщо увімкнено, попереднє зображення буде використовуватися як довідник замість створення нового з нуля.
751
753
  img.save.title = Зберегти зображення
752
754
  img.status.downloading = Завантаження...
753
755
  img.status.error = Помилка генерації зображення
@@ -1677,6 +1679,8 @@ updater.check.launch = Перевіряти при запуску
1677
1679
  update.released = збірка
1678
1680
  update.snap = Перейти до Snap Store
1679
1681
  update.title = Перевірка оновлень
1682
+ video.remix = Ремікс/Розширити
1683
+ video.remix.tooltip = Увімкнути ремікс/розширення з попереднього відео у контексті (Sora2, Veo3.1).\nЯкщо увімкнено, попереднє відео буде використовуватися як довідник замість створення нового з нуля.
1680
1684
  vid.status.downloading = Завантаження відео... будь ласка, зачекайте...
1681
1685
  vid.status.generating = Генерація відео з
1682
1686
  vid.status.prompt.error = Виникла помилка під час покращення запиту
@@ -748,6 +748,8 @@ idx.token.warn = 这将消耗额外的 token 来嵌入数据。
748
748
  img.action.open = 打开全尺寸
749
749
  img.action.save = 另存为...
750
750
  img.raw = 原始模式
751
+ img.remix = 混音/扩展
752
+ img.remix.tooltip = 启用上下文中从上一个图像的混音/扩展。\n如果启用,将使用上一个图像作为参考,而不是从头创建一个新图像。
751
753
  img.save.title = 保存图片
752
754
  img.status.downloading = 正在下载...
753
755
  img.status.error = 图像生成错误
@@ -1677,6 +1679,8 @@ updater.check.launch = 啟動時檢查
1677
1679
  update.released = 發布時間
1678
1680
  update.snap = 前往Snap商店
1679
1681
  update.title = 檢查更新中
1682
+ video.remix = 混音/扩展
1683
+ video.remix.tooltip = 启用上下文中从上一个视频的混音/扩展 (Sora2, Veo3.1)。\n如果启用,将使用上一个视频作为参考,而不是从头创建一个新视频。
1680
1684
  vid.status.downloading = 正在下载视频...请稍候...
1681
1685
  vid.status.generating = 正在从中生成视频
1682
1686
  vid.status.prompt.error = 提示增强出错