Efradeca commited on
Commit
7cd7227
·
verified ·
1 Parent(s): 42d5e9c

chore: deploy private lightloom build

Browse files
app.py CHANGED
@@ -1175,7 +1175,7 @@ def _scroll_live_phrase(session: str, text: str, audio_b64: str, lang: str):
1175
  if (text or "").strip() == "__warm__" or (audio_b64 or "").strip() == "__warm__":
1176
  try:
1177
  from lightloom.paint.scroll import outpaint_right as _ow
1178
- _warm = _ow(pipe, None, "a calm open landscape at dawn", seg_w=576, height=768, overlap=192, steps=4, seed=1)
1179
  estimate_depth(depth_pipe, _warm, normalize=False) # warm the depth forward too
1180
  except Exception: # noqa: BLE001 - warming is best-effort; never block the session.
1181
  pass
@@ -1350,11 +1350,11 @@ def _scroll_live_phrase(session: str, text: str, audio_b64: str, lang: str):
1350
  # which the user found CLONED one scene (the opening neon city, "pegada"). If this feels too sticky
1351
  # ("se queda en la escena anterior"), dial overlap back toward 160. Coherence = carried previous strip
1352
  # + fixed session style (TEXT), NOT a frozen scene-0 lock.
1353
- # overlap 192 / seg 576: the balanced seamless carry. overlap 256 (tested) was TOO STICKY — narrative prose
1354
- # ("they had no athletic equipment", not a scene description) couldn't shift the established scene so the
1355
- # world got STUCK on it ("se atascó en una llanura"). 192 keeps the "una sola imagen" coherence while still
1356
- # letting a new CONCRETE subject take over. 192+576=768; the __warm__ call below is matched to 192/576.
1357
- h, overlap, seg = 768, 192, 576
1358
  # 2 strips/phrase: 3 strips RE-PAINTED the same subject 3x ("dije shark una vez y aparece repetido" -> 3
1359
  # sharks), reading as incoherent repetition. 2 keeps a scene SUSTAINED (longer than 1) but with a subtler
1360
  # change per phrase; the overlap=192 carry + the fragment-continue above hold the single-image coherence.
@@ -1400,31 +1400,26 @@ def _scroll_live_phrase(session: str, text: str, audio_b64: str, lang: str):
1400
  # saturated SKY filling the strip's LEFT (which never reaches the next paint) must NOT trip a
1401
  # needless fresh repaint (the false-positive cut that read as the world resetting).
1402
  _ctx_edge = ctx.crop((ctx.width - overlap, 0, ctx.width, ctx.height)) if ctx is not None else None
1403
- if _ctx_edge is not None and _strip_looks_corrupt(_ctx_edge):
 
 
 
 
 
1404
  use_ctx = None
1405
  else:
1406
  use_ctx = ctx
1407
- # ABSTRACTION guard: if the carried EDGE has LOST STRUCTURE (smooth colour fields), heal
1408
- # ONLY that rightmost `overlap` region toward the clean first strip's edge (matched width,
1409
- # NO horizontal stretch — the old code stretched a 128px anchor edge to 576px, smearing in
1410
- # exactly the low-frequency content it was meant to fight). The rest of use_ctx is left
1411
- # untouched; only the kept overlap influences the next paint, never the panorama.
1412
- # ABSTRACTION-HEAL DISABLED (audit w368kb6kp): blending the carried edge toward the section-0
1413
- # anchor (Image.blend 0.25..0.70) averaged two unrelated scenes into a muddy low-frequency band
1414
- # pasted into the kept overlap -> the returned grey-fog smear between scenes — and it fired on
1415
- # smooth-but-VALID skies (which score the same as a teal void). Plain carry + the corruption/
1416
- # saturation guard above is enough; a properly-gated heal can return later if long-session drift
1417
- # reappears. use_ctx carries unmodified.
1418
  # SMOOTH continuation: paint each strip as the current subject, carrying the previous strip
1419
  # as context, with NO morph band. The morph_band dissolve (an 8px->128px stretch of the
1420
  # carried edge) is what put a foggy blurry smear between every scene; the plain outpaint
1421
  # already lets a new spoken subject emerge from the carried scene fluidly, like before.
1422
  sec = outpaint_right(pipe, use_ctx, paint_prompt, seg_w=seg, height=h, overlap=overlap, steps=4, seed=200 + g * 3, image_reference=cast_ref)
1423
- # also re-check the FRESHLY painted strip: if IT overflowed into corruption, repaint
1424
- # once from scratch (no carried ctx) BEFORE saving/streaming, so the saturated strip is
1425
- # never shown at all (the ctx-guard above only protects the NEXT strip, not this one).
1426
- if _strip_looks_corrupt(sec):
1427
- sec = outpaint_right(pipe, None, paint_prompt, seg_w=seg, height=h, overlap=overlap, steps=4, seed=211 + g * 3)
 
1428
  ctx = sec
1429
  sec.save(out_dir / f"section-{g}.webp", "WEBP", quality=92)
1430
  yield {
 
1175
  if (text or "").strip() == "__warm__" or (audio_b64 or "").strip() == "__warm__":
1176
  try:
1177
  from lightloom.paint.scroll import outpaint_right as _ow
1178
+ _warm = _ow(pipe, None, "a calm open landscape at dawn", seg_w=556, height=768, overlap=212, steps=4, seed=1)
1179
  estimate_depth(depth_pipe, _warm, normalize=False) # warm the depth forward too
1180
  except Exception: # noqa: BLE001 - warming is best-effort; never block the session.
1181
  pass
 
1350
  # which the user found CLONED one scene (the opening neon city, "pegada"). If this feels too sticky
1351
  # ("se queda en la escena anterior"), dial overlap back toward 160. Coherence = carried previous strip
1352
  # + fixed session style (TEXT), NOT a frozen scene-0 lock.
1353
+ # overlap 212 / seg 556: a slightly STRONGER carry than 192 (more carried context -> fewer grey transition
1354
+ # bands) but well short of the 256 that got STUCK on narrative prose. 212+556=768; the __warm__ call below
1355
+ # is matched to 212/556. The grey-band ROOT cause is also fixed in scroll.py (the fresh region is now seeded
1356
+ # from the carried edge's average colour, not the jarring grey 128 base).
1357
+ h, overlap, seg = 768, 212, 556
1358
  # 2 strips/phrase: 3 strips RE-PAINTED the same subject 3x ("dije shark una vez y aparece repetido" -> 3
1359
  # sharks), reading as incoherent repetition. 2 keeps a scene SUSTAINED (longer than 1) but with a subtler
1360
  # change per phrase; the overlap=192 carry + the fragment-continue above hold the single-image coherence.
 
1400
  # saturated SKY filling the strip's LEFT (which never reaches the next paint) must NOT trip a
1401
  # needless fresh repaint (the false-positive cut that read as the world resetting).
1402
  _ctx_edge = ctx.crop((ctx.width - overlap, 0, ctx.width, ctx.height)) if ctx is not None else None
1403
+ # DROP the carried context if its right EDGE is corrupt (saturated) OR has COLLAPSED into a flat,
1404
+ # near-structureless colour field (the green block / iridescent waves / dark smudge). Carrying such
1405
+ # an edge propagates the bad scene forever; starting the next strip fresh from the (concrete) prompt
1406
+ # breaks the chain. This RESTORES the long-session drift safety net the abstraction-heal used to give
1407
+ # — but by DROPPING the bad context, NOT blending toward section-0 (which caused the grey-fog smear).
1408
+ if _ctx_edge is not None and (_strip_looks_corrupt(_ctx_edge) or _strip_looks_abstract(_ctx_edge) > 0.5):
1409
  use_ctx = None
1410
  else:
1411
  use_ctx = ctx
 
 
 
 
 
 
 
 
 
 
 
1412
  # SMOOTH continuation: paint each strip as the current subject, carrying the previous strip
1413
  # as context, with NO morph band. The morph_band dissolve (an 8px->128px stretch of the
1414
  # carried edge) is what put a foggy blurry smear between every scene; the plain outpaint
1415
  # already lets a new spoken subject emerge from the carried scene fluidly, like before.
1416
  sec = outpaint_right(pipe, use_ctx, paint_prompt, seg_w=seg, height=h, overlap=overlap, steps=4, seed=200 + g * 3, image_reference=cast_ref)
1417
+ # CATCH a bad FRESH strip before it is shown/carried: saturated corruption OR a collapse into a flat
1418
+ # near-structureless colour field (the green block / iridescent waves / dark smudge the saturation
1419
+ # guard misses). Reroll it (new seed) carrying the already-validated context, so a bad ROLL is fixed
1420
+ # while continuity is kept; if use_ctx was dropped above, this is a clean fresh repaint instead.
1421
+ if _strip_looks_corrupt(sec) or _strip_looks_abstract(sec) > 0.5:
1422
+ sec = outpaint_right(pipe, use_ctx, paint_prompt, seg_w=seg, height=h, overlap=overlap, steps=4, seed=211 + g * 3)
1423
  ctx = sec
1424
  sec.save(out_dir / f"section-{g}.webp", "WEBP", quality=92)
1425
  yield {
src/lightloom/paint/scroll.py CHANGED
@@ -132,6 +132,12 @@ def outpaint_right(
132
  ctx = ctx.resize((overlap, height))
133
  canvas.paste(ctx, (0, 0))
134
  mask.paste(Image.new("L", (overlap, height), 0), (0, 0)) # …but KEEP the overlap as context
 
 
 
 
 
 
135
  if sdedit_strength is not None:
136
  # LAMINAR v1: SEED the whole new region with the carried SCENE (the previous
137
  # strip stretched across the seg) and DENOISE it only partially (strength<1), so
 
132
  ctx = ctx.resize((overlap, height))
133
  canvas.paste(ctx, (0, 0))
134
  mask.paste(Image.new("L", (overlap, height), 0), (0, 0)) # …but KEEP the overlap as context
135
+ # SEED the fresh region with the carried edge's AVERAGE colour instead of the jarring grey (128,128,128)
136
+ # base, so a weak/under-denoised 4-step strip blends into the scene's palette rather than leaking a grey
137
+ # band between scenes (the recurring "manchas grises"). Flat colour only -> no structure, so it cannot
138
+ # re-clone the previous scene. The sdedit/morph branches below still override this when active.
139
+ _avg = ctx.resize((1, 1)).getpixel((0, 0))
140
+ canvas.paste(Image.new("RGB", (seg_w, height), _avg), (overlap, 0))
141
  if sdedit_strength is not None:
142
  # LAMINAR v1: SEED the whole new region with the carried SCENE (the previous
143
  # strip stretched across the seg) and DENOISE it only partially (strength<1), so
src/lightloom/vision/__init__.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ """Vision post-process (Director's Cut). The MiniCPM-V-4.6 'Art Director' world-seer lives here. It runs
2
+ ONLY in the session-end post-process, never on the live painter path."""