MCPcopy Create free account
hub / github.com/TheLastBen/fast-stable-diffusion / get_block_instance

Method get_block_instance

Dreambooth/blocks.py:587–602  ·  view source on GitHub ↗
(id: int)

Source from the content-addressed store, hash-verified

585 original_mapping: Dict[int, Block] = {}
586
587 def get_block_instance(id: int) -> Block:
588 for block_config in components_config:
589 if block_config["id"] == id:
590 break
591 else:
592 raise ValueError("Cannot find block with id {}".format(id))
593 cls = component_or_layout_class(block_config["type"])
594 block_config["props"].pop("type", None)
595 block_config["props"].pop("name", None)
596 style = block_config["props"].pop("style", None)
597 if block_config["props"].get("root_url") is None and root_url:
598 block_config["props"]["root_url"] = root_url + "/"
599 block = cls(**block_config["props"])
600 if style:
601 block.style(**style)
602 return block
603
604 def iterate_over_children(children_list):
605 for child_config in children_list:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected