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

Method preprocess_data

Dreambooth/blocks.py:880–894  ·  view source on GitHub ↗
(self, fn_index: int, inputs: List[Any], state: Dict[int, Any])

Source from the content-addressed store, hash-verified

878 return predictions
879
880 def preprocess_data(self, fn_index: int, inputs: List[Any], state: Dict[int, Any]):
881 block_fn = self.fns[fn_index]
882 dependency = self.dependencies[fn_index]
883
884 if block_fn.preprocess:
885 processed_input = []
886 for i, input_id in enumerate(dependency["inputs"]):
887 block: IOComponent = self.blocks[input_id]
888 if getattr(block, "stateful", False):
889 processed_input.append(state.get(input_id))
890 else:
891 processed_input.append(block.preprocess(inputs[i]))
892 else:
893 processed_input = inputs
894 return processed_input
895
896 def postprocess_data(
897 self, fn_index: int, predictions: List[Any], state: Dict[int, Any]

Callers 1

process_apiMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected