@danhachuel/thunderbolt 0.4.28 → 0.4.29
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.
- package/hermes_ui/thumbnails.py +10 -2
- package/package.json +1 -1
package/hermes_ui/thumbnails.py
CHANGED
|
@@ -10,8 +10,9 @@ from typing import Any
|
|
|
10
10
|
from .creative_generation import generate_thumbnail_prompt
|
|
11
11
|
from .media_generation import generate_image_from_pool
|
|
12
12
|
from .media_providers import media_cards_for_pool
|
|
13
|
-
from .storage import STORAGE, now, read_json, update_json
|
|
13
|
+
from .storage import STORAGE, ensure_storage, now, read_json, update_json
|
|
14
14
|
from .thumbnail_generation import ThumbnailGenerationError, generate_thumbnail_image
|
|
15
|
+
from .thumbnail_blueprints import thumbnail_blueprint_for_channel
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
def _generate_image_with_pool(
|
|
@@ -290,12 +291,19 @@ def regenerate_thumbnail_prompt(
|
|
|
290
291
|
topic = record["topic"] or record["title"]
|
|
291
292
|
if not topic:
|
|
292
293
|
raise ThumbnailGenerationError("A tarefa não tem tópico para refazer o prompt da thumbnail.")
|
|
294
|
+
ensure_storage()
|
|
295
|
+
visual_blueprint = thumbnail_blueprint_for_channel(
|
|
296
|
+
{**(channel or {}), "thumbnail_blueprint_id": record.get("thumbnail_blueprint_id") or (channel or {}).get("thumbnail_blueprint_id", "")}
|
|
297
|
+
)
|
|
298
|
+
effective_blueprint = {**(blueprint or {})}
|
|
299
|
+
if visual_blueprint.get("content"):
|
|
300
|
+
effective_blueprint["thumbnail_blueprint_rules"] = visual_blueprint["content"]
|
|
293
301
|
variant = generate_thumbnail_prompt(
|
|
294
302
|
settings,
|
|
295
303
|
channel or {},
|
|
296
304
|
topic,
|
|
297
305
|
current_prompt=record["prompt"],
|
|
298
|
-
blueprint=
|
|
306
|
+
blueprint=effective_blueprint,
|
|
299
307
|
language=language,
|
|
300
308
|
)
|
|
301
309
|
updated = _update_thumbnail_task(
|
package/package.json
CHANGED