Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9aa91bb0a |
@@ -0,0 +1,3 @@
|
||||
# DOGMA 1.0.58
|
||||
|
||||
Add `DOGMASeedanceVideoFix`, a standalone native VIDEO adapter for the existing 1.0.57 stutter repair. It takes only the generated video and returns the corrected video, with progress, cancellation and a clear result status. No API jobs or original-footage input. Native LoadVideo and SaveVideo complete the three-node workflow. Keep SaveVideo codec auto to avoid a second re-encode. Existing nodes and the API Platform repair engine are unchanged; no new dependencies.
|
||||
@@ -213,3 +213,12 @@ Enable **Correggi scatti** in Video to save both the original and `_FIX.mp4`. Bo
|
||||
The detector operates on small previews; RIFE reconstructs only selected frames at source resolution. Reliable pans with repeated jumps may additionally receive small camera translations, capped at 0.4% of width/height. This extends a thin edge strip by reflection instead of cropping or zooming. Camera refinement and interpolation share one encoding pass. Clean clips, poorly tracked shots, zooms and reversing camera paths are not stabilized. Frame count, timestamps, source bit depth and audio packet identity are checked before accepting the second file. A motion-based quality gate is an additional check, not a guarantee against every possible visual artifact. The method is independent of source fps and has no fixed clip-duration setting; processing time and memory grow with frame count and resolution. It does not impose 24 fps. CUDA and NVIDIA video encoding provide the fast path; CPU/software fallback is slower. First use includes model download and GPU initialization. No video is uploaded to another service. Generative deformations or newly invented content cannot be reliably restored by a cadence repair.
|
||||
|
||||
RIFE 4.26 code/weights: https://github.com/hzwer/Practical-RIFE (MIT; LICENSE_RIFE.txt). Verified weights are automatically cached under `models/DOGMA/rife`. Architecture derived from the official model archive, revision `01fdc7e97404120c243c3ea7b427046e5dc7643e`. DOGMA motion detection, timestamp planning and integration are separate from RIFE inference. No other ComfyUI interpolation extension is required.
|
||||
|
||||
|
||||
## Standalone Seedance fix / 1.0.58
|
||||
|
||||
`Load Video → DOGMA / Fix video Seedance → Save Video` uses only the generated video. No original footage, API generation, credentials or credits are needed. The node reuses the unchanged 1.0.57 repair engine and its cached RIFE weights. Progress and a short result message are reported in ComfyUI. Clips without confidently detected stutter are returned unchanged; a rejected correction is explicitly reported as unchanged.
|
||||
|
||||
Use MP4 and codec **auto** in Save Video to preserve the corrected stream without another encoding pass. The supplied standalone workflow writes to `output/DOGMA/SeedanceFix/Seedance_FIX_*.mp4`. Duration, fps, frame timestamps, dimensions, color depth and audio are checked by the repair engine. The uploaded source is not overwritten. The fix runs outside the async event loop; Stop cancels processing and removes that attempt's partial files. Intermediate output and diagnostics live in ComfyUI's temp directory, so cached results can be saved again without repeating inference.
|
||||
|
||||
Existing API Platform, H3 and HDR workflows remain compatible. The same package supports Windows and the pod. No extra node pack is required.
|
||||
|
||||
+12
@@ -243,3 +243,15 @@ try:
|
||||
del _APIV2, _APIV2_NAMES, _APIV2_ROUTES
|
||||
except Exception as _apiv2_error:
|
||||
print("[DOGMA API V2] Unavailable; previous DOGMA nodes preserved:", _apiv2_error)
|
||||
|
||||
|
||||
# Standalone Seedance fix: same engine as API Platform, one VIDEO input.
|
||||
try:
|
||||
from .dogma_video_fix_node import NODE_CLASS_MAPPINGS as _FIX158, NODE_DISPLAY_NAME_MAPPINGS as _FIX158_NAMES
|
||||
if set(_FIX158).intersection(NODE_CLASS_MAPPINGS):
|
||||
raise RuntimeError("DOGMA Seedance fix: node ID collision")
|
||||
NODE_CLASS_MAPPINGS.update(_FIX158)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(_FIX158_NAMES)
|
||||
del _FIX158, _FIX158_NAMES
|
||||
except Exception as _fix158_error:
|
||||
print("[DOGMA Seedance fix] Unavailable; previous DOGMA nodes preserved:", _fix158_error)
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
"""Standalone VIDEO adapter for the same repair engine used by API Platform."""
|
||||
import asyncio
|
||||
import json
|
||||
from pathlib import Path
|
||||
import tempfile
|
||||
import threading
|
||||
|
||||
from comfy_api.latest import io, ui, InputImpl, Types
|
||||
|
||||
|
||||
class DOGMASeedanceVideoFix(io.ComfyNode):
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
return io.Schema(
|
||||
node_id="DOGMASeedanceVideoFix",
|
||||
display_name="DOGMA / Fix video Seedance",
|
||||
category="DOGMA/Video",
|
||||
description="Corregge gli scatti del solo video generato da Seedance. "
|
||||
"Mantiene fps, durata, risoluzione e audio. Non richiede il video originale o API.",
|
||||
inputs=[io.Video.Input("video", tooltip="Collega il video generato da Seedance.")],
|
||||
outputs=[io.Video.Output("video_corretto")],
|
||||
hidden=[io.Hidden.unique_id],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
async def execute(cls, video):
|
||||
cancelled=threading.Event()
|
||||
worker=asyncio.create_task(asyncio.to_thread(cls._repair,video,cancelled,cls.hidden.unique_id))
|
||||
try:
|
||||
result,summary=await asyncio.shield(worker)
|
||||
return io.NodeOutput(result,ui=ui.PreviewText(summary))
|
||||
except asyncio.CancelledError:
|
||||
cancelled.set()
|
||||
try:await worker
|
||||
except Exception:pass
|
||||
raise
|
||||
|
||||
@staticmethod
|
||||
def _repair(video,cancelled,node_id=None):
|
||||
import folder_paths
|
||||
import comfy.model_management as management
|
||||
from comfy.utils import ProgressBar
|
||||
from .dogma_video_repair import RepairCancelled,repair_video
|
||||
|
||||
progress=ProgressBar(100,node_id=node_id)
|
||||
def check():
|
||||
if cancelled.is_set():raise RepairCancelled("Correzione interrotta.")
|
||||
management.throw_exception_if_processing_interrupted()
|
||||
def update(stage,fraction):
|
||||
check()
|
||||
progress.update_absolute(round(max(0,min(1,fraction))*100))
|
||||
|
||||
check()
|
||||
root=Path(folder_paths.get_temp_directory());root.mkdir(parents=True,exist_ok=True)
|
||||
work=Path(tempfile.mkdtemp(prefix="dogma-seedance-fix-",dir=root))
|
||||
source=work/'input.mp4';fixed=work/'corrected.mp4';report_file=work/'repair.json'
|
||||
try:
|
||||
# Native save remuxes uploaded MP4 streams. It also honors VIDEO trims
|
||||
# if this node is reused in a larger graph, without tensorizing the clip.
|
||||
video.save_to(str(source),format=Types.VideoContainer.MP4,codec=Types.VideoCodec.AUTO)
|
||||
check()
|
||||
report=repair_video(source,fixed,Path(folder_paths.models_dir)/'DOGMA'/'rife',cancel=check,progress=update)
|
||||
check()
|
||||
if report['status']=='repaired':
|
||||
summary=f"Correzione completata · {report['fps']} fps · {report['interpolated_frames']} fotogrammi ricostruiti"
|
||||
elif report['status']=='unchanged':
|
||||
summary="Nessuno scatto riconosciuto: il video è rimasto invariato."
|
||||
else:
|
||||
summary="Correzione non applicata: il controllo non ha confermato un miglioramento. Video invariato."
|
||||
report_file.write_text(json.dumps(report,ensure_ascii=False,indent=2),encoding='utf8')
|
||||
source.unlink()
|
||||
# The result stays in Comfy's temp directory for SaveVideo and caching.
|
||||
return InputImpl.VideoFromFile(str(fixed)),summary
|
||||
except BaseException:
|
||||
for path in (source,fixed,report_file):path.unlink(missing_ok=True)
|
||||
work.rmdir()
|
||||
raise
|
||||
|
||||
|
||||
NODE_CLASS_MAPPINGS={"DOGMASeedanceVideoFix":DOGMASeedanceVideoFix}
|
||||
NODE_DISPLAY_NAME_MAPPINGS={"DOGMASeedanceVideoFix":"DOGMA / Fix video Seedance"}
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-dogma-nodes"
|
||||
description = "Custom ComfyUI nodes for DOGMA AI video workflows."
|
||||
version = "1.0.57"
|
||||
version = "1.0.58"
|
||||
license = { file = "LICENSE" }
|
||||
dependencies = ["scipy>=1.10", "av>=18.0", "opencv-python>=4.8"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user