Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,19 @@ def main(output_dir: str):

data = {
"_class_name": "DreamIDOmniPipeline",
"fusion": "DreamID-Omni/dreamid_omni.safetensors",
}

with open(os.path.join(output_dir, "model_index.json"), "w", encoding="utf-8") as f:
json.dump(data, f, indent=2)

print(f"model_index.json created at {os.path.join(output_dir, 'model_index.json')}")

transformer_dir = os.path.join(output_dir, "transformer")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we need the config.json only

os.makedirs(transformer_dir, exist_ok=True)
with open(os.path.join(transformer_dir, "config.json"), "w", encoding="utf-8") as f:
json.dump({"fusion": "DreamID-Omni/dreamid_omni.safetensors"}, f)
print(f"transformer/config.json created at {os.path.join(transformer_dir, 'config.json')}")

# now we download the dependency code
download_dependency()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ dreamid_omni/
│ ├── models_t5_umt5-xxl-enc-bf16.pth
│ ├── Wan2.2_VAE.pth
├── model_index.json # create by download_dreamid_omni.py
├── model_index.json
└── transformer/
└── config.json # create by download_dreamid_omni.py
```

### Run the Inference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ def main() -> None:
if not outputs:
raise RuntimeError("No output returned from DreamID-Omni.")
output = outputs[0].request_output
generated_video = output[0].images[0][0]
generated_audio = output[0].images[0][1]
generated_video = output.images[0][0]
generated_audio = output.images[0][1]
try:
from dreamid_omni.utils.io_utils import save_video
except Exception as e:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def __init__(
## load audio/video model config
Fusion_model = FusionModel(VIDEO_CONFIG, AUDIO_CONFIG)

checkpoint_path = self.od_config.model_config.get("fusion", None)
checkpoint_path = self.od_config.tf_model_config.get("fusion", None)
assert checkpoint_path is not None, "fusion checkpoint path is None"
load_fusion_checkpoint(Fusion_model, checkpoint_path=os.path.join(model, checkpoint_path))
self.model = Fusion_model
Expand Down
Loading