signsur4739379373 commited on
Commit
9da24db
·
1 Parent(s): 35e3bb5

Default presets to anchor only

Browse files
Files changed (1) hide show
  1. app.py +16 -10
app.py CHANGED
@@ -488,7 +488,17 @@ def _inject_params(
488
  anchor = workflow.get(NODE_LIKENESS_ANCHOR, {}).get("inputs", {})
489
  latent_anchor = workflow.get(NODE_LATENT_ANCHOR, {}).get("inputs", {})
490
 
491
- if preset == "original":
 
 
 
 
 
 
 
 
 
 
492
  guide["strength"] = likeness_strength
493
  guide["placement_mode"] = "silent_reference"
494
  guide["face_detect"] = "manual"
@@ -536,10 +546,6 @@ def _inject_params(
536
  guide["face_bbox_within_reference"] = face_bbox.strip()
537
  anchor["frame_0_bbox"] = face_bbox.strip()
538
 
539
- elif mode == "anchor only":
540
- guide["strength"] = 0.0
541
- anchor["strength"] = 0.0
542
- latent_anchor["strength"] = latent_anchor_strength
543
  else:
544
  guide["strength"] = likeness_strength
545
  guide["placement_mode"] = "silent_reference"
@@ -765,14 +771,14 @@ if os.environ.get("SKIP_STARTUP_SETUP") != "1":
765
  def apply_preset(preset: str):
766
  if preset == "original":
767
  return (
768
- gr.update(value="auto face"),
769
  gr.update(value=0.9),
770
  gr.update(value=0.5),
771
  gr.update(value=0.11),
772
  gr.update(value=0.77),
773
  )
774
  return (
775
- gr.update(value="auto face"),
776
  gr.update(value=0.9),
777
  gr.update(value=0.15),
778
  gr.update(value=0.08),
@@ -796,9 +802,9 @@ with gr.Blocks(title="LTX image-to-video") as demo:
796
  mode = gr.Radio(["anchor only", "auto face", "manual bbox"], value="anchor only", label="face mode")
797
  face_bbox = gr.Textbox(label="manual bbox", placeholder="x1,y1,x2,y2, normalized 0-1")
798
  likeness_strength = gr.Slider(0.0, 1.0, value=0.9, step=0.05, label="likeness guide")
799
- likeness_anchor_strength = gr.Slider(0.0, 1.0, value=0.18, step=0.01, label="likeness anchor")
800
- latent_anchor_strength = gr.Slider(0.0, 0.5, value=0.11, step=0.01, label="latent anchor")
801
- first_frame_strength = gr.Slider(0.0, 1.0, value=0.77, step=0.01, label="first frame strength")
802
  with gr.Row():
803
  seed = gr.Number(label="seed", value=-1, precision=0)
804
  randomize = gr.Checkbox(label="randomize seed", value=True)
 
488
  anchor = workflow.get(NODE_LIKENESS_ANCHOR, {}).get("inputs", {})
489
  latent_anchor = workflow.get(NODE_LATENT_ANCHOR, {}).get("inputs", {})
490
 
491
+ if mode == "anchor only":
492
+ guide["strength"] = 0.0
493
+ guide["face_detect"] = "none"
494
+ guide["face_bbox_within_reference"] = ""
495
+ anchor["strength"] = 0.0
496
+ anchor["bypass"] = True
497
+ anchor["frame_0_bbox"] = ""
498
+ anchor["override_face_bbox"] = ""
499
+ latent_anchor["strength"] = latent_anchor_strength
500
+
501
+ elif preset == "original":
502
  guide["strength"] = likeness_strength
503
  guide["placement_mode"] = "silent_reference"
504
  guide["face_detect"] = "manual"
 
546
  guide["face_bbox_within_reference"] = face_bbox.strip()
547
  anchor["frame_0_bbox"] = face_bbox.strip()
548
 
 
 
 
 
549
  else:
550
  guide["strength"] = likeness_strength
551
  guide["placement_mode"] = "silent_reference"
 
771
  def apply_preset(preset: str):
772
  if preset == "original":
773
  return (
774
+ gr.update(value="anchor only"),
775
  gr.update(value=0.9),
776
  gr.update(value=0.5),
777
  gr.update(value=0.11),
778
  gr.update(value=0.77),
779
  )
780
  return (
781
+ gr.update(value="anchor only"),
782
  gr.update(value=0.9),
783
  gr.update(value=0.15),
784
  gr.update(value=0.08),
 
802
  mode = gr.Radio(["anchor only", "auto face", "manual bbox"], value="anchor only", label="face mode")
803
  face_bbox = gr.Textbox(label="manual bbox", placeholder="x1,y1,x2,y2, normalized 0-1")
804
  likeness_strength = gr.Slider(0.0, 1.0, value=0.9, step=0.05, label="likeness guide")
805
+ likeness_anchor_strength = gr.Slider(0.0, 1.0, value=0.15, step=0.01, label="likeness anchor")
806
+ latent_anchor_strength = gr.Slider(0.0, 0.5, value=0.08, step=0.01, label="latent anchor")
807
+ first_frame_strength = gr.Slider(0.0, 1.0, value=0.82, step=0.01, label="first frame strength")
808
  with gr.Row():
809
  seed = gr.Number(label="seed", value=-1, precision=0)
810
  randomize = gr.Checkbox(label="randomize seed", value=True)