From 0bf9f3f272f4b3c3d0a850a9fdc270984cb2dfbe Mon Sep 17 00:00:00 2001 From: digital-garbage <133010426+digital-garbage@users.noreply.github.com> Date: Wed, 6 May 2026 22:12:48 +0300 Subject: [PATCH] Use learned memory before seeding lucky prompts --- CHANGELOG.md | 2 ++ conditioning.py | 29 ++++++++++++++-------------- docs/FunPackGemmaEmbeddingRefiner.md | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4585ee99..7b24f695 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,8 @@ Updated `I'm Feeling Lucky` filtering to learn poor adjacent token pairs instead Updated `I'm Feeling Lucky` with uncapped token, pair, and context memory so it can learn which concepts belong together and call strong missing neighbors when prompt anchors are present. +Fixed `I'm Feeling Lucky` composition order so the current generation uses already-learned memory first, then seeds current prompt tokens for future runs. + ## [2.1.3] - 2026-04-24 ### Changed diff --git a/conditioning.py b/conditioning.py index a2b7541d..631088ef 100644 --- a/conditioning.py +++ b/conditioning.py @@ -3746,22 +3746,13 @@ class FunPackVideoRefiner: token_mask=bank_rated_token_mask, ) - if analysis_prompt and analysis_prompt != bank_rated_prompt: - self._seed_void_token_bank( - global_adaptive, - word_groups, - cur_positive, - iter_num, - token_mask=active_token_mask, - ) - elif bank_rated_positive is None: - self._seed_void_token_bank( - global_adaptive, - word_groups, - cur_positive, - iter_num, - token_mask=active_token_mask, + should_seed_current_prompt_after_lucky = ( + bool(analysis_prompt) and + ( + analysis_prompt != bank_rated_prompt or + bank_rated_positive is None ) + ) if feedback_enabled and pending is not None: self._apply_concept_feedback( @@ -4070,6 +4061,14 @@ class FunPackVideoRefiner: token_mask=active_token_mask, prompt_sequences=self._lucky_prompt_sequences(prompt_histories), ) + if should_seed_current_prompt_after_lucky: + self._seed_void_token_bank( + global_adaptive, + word_groups, + cur_positive, + iter_num, + token_mask=active_token_mask, + ) # Update momentum momentum = 0.75 * momentum + 0.25 * (new_delta * reward) diff --git a/docs/FunPackGemmaEmbeddingRefiner.md b/docs/FunPackGemmaEmbeddingRefiner.md index a9fafaa7..2b41a08d 100644 --- a/docs/FunPackGemmaEmbeddingRefiner.md +++ b/docs/FunPackGemmaEmbeddingRefiner.md @@ -92,7 +92,7 @@ Use it when you want to discover surprising concept-concept pairs or learn which `im_feeling_lucky` is the automated prompt-composer path. Instead of requiring the current prompt to name every action, camera move, or styling cue, it learns which tokens and concepts the user tends to prefer and applies them directly to conditioning. If the prompt contains a known anchor, Lucky can add strongly rated missing neighbours that commonly work with that anchor. If the prompt is vague, it uses global learned preferences so the result still has something intentional to look at. -Lucky stores token, pair, and context memory without a fixed cap. Tokens stay available unless their embeddings are invalid; bad ratings teach the refiner to avoid specific adjacent token pairs or contexts first. With changing prompts, the previous generation's rating is applied to the previous prompt and its injected Lucky tokens, while the current prompt contributes fresh neutral tokens for Lucky to try. It can run by itself or alongside `into_the_void`. +Lucky stores token, pair, and context memory without a fixed cap. Tokens stay available unless their embeddings are invalid; bad ratings teach the refiner to avoid specific adjacent token pairs or contexts first. With changing prompts, the previous generation's rating is applied to the previous prompt and its injected Lucky tokens, then Lucky composes the current generation from that already-learned memory. The current prompt contributes fresh neutral tokens only after current Lucky composition, so new words become material for future runs rather than steering the same run. It can run by itself or alongside `into_the_void`. ## Latent Refinement