Skip to content

Commit d0c72b2

Browse files
committed
update
1 parent cae82a7 commit d0c72b2

3 files changed

Lines changed: 258 additions & 101 deletions

File tree

src/diffusers/commands/custom_blocks.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,12 @@ def run(self):
103103
spec = importlib.util.spec_from_file_location(module_name, str(self.block_module_name))
104104
module = importlib.util.module_from_spec(spec)
105105
spec.loader.exec_module(module)
106-
getattr(module, child_class)().save_pretrained(os.getcwd())
106+
block = getattr(module, child_class)()
107+
block.save_pretrained(os.getcwd())
108+
# `ModularPipeline.from_pretrained` (and therefore `diffusers-cli run`) loads a repo
109+
# through `modular_model_index.json`, which only the pipeline-level save writes — without
110+
# it the packaged repo is importable as blocks but not runnable as a pipeline.
111+
block.init_pipeline().save_pretrained(os.getcwd())
107112

108113
def _choose_block(self, candidates, chosen=None):
109114
for cls, base in candidates:

0 commit comments

Comments
 (0)