MCPcopy Index your code
hub / github.com/modelscope/DiffSynth-Studio / __call__

Method __call__

diffsynth/utils/__init__.py:261–287  ·  view source on GitHub ↗
(self, unit: PipelineUnit, pipe: BasePipeline, inputs_shared: dict, inputs_posi: dict, inputs_nega: dict)

Source from the content-addressed store, hash-verified

259 pass
260
261 def __call__(self, unit: PipelineUnit, pipe: BasePipeline, inputs_shared: dict, inputs_posi: dict, inputs_nega: dict) -> tuple[dict, dict]:
262 if unit.take_over:
263 # Let the pipeline unit take over this function.
264 inputs_shared, inputs_posi, inputs_nega = unit.process(pipe, inputs_shared=inputs_shared, inputs_posi=inputs_posi, inputs_nega=inputs_nega)
265 elif unit.seperate_cfg:
266 # Positive side
267 processor_inputs = {name: inputs_posi.get(name_) for name, name_ in unit.input_params_posi.items()}
268 if unit.input_params is not None:
269 for name in unit.input_params:
270 processor_inputs[name] = inputs_shared.get(name)
271 processor_outputs = unit.process(pipe, **processor_inputs)
272 inputs_posi.update(processor_outputs)
273 # Negative side
274 if inputs_shared["cfg_scale"] != 1:
275 processor_inputs = {name: inputs_nega.get(name_) for name, name_ in unit.input_params_nega.items()}
276 if unit.input_params is not None:
277 for name in unit.input_params:
278 processor_inputs[name] = inputs_shared.get(name)
279 processor_outputs = unit.process(pipe, **processor_inputs)
280 inputs_nega.update(processor_outputs)
281 else:
282 inputs_nega.update(processor_outputs)
283 else:
284 processor_inputs = {name: inputs_shared.get(name) for name in unit.input_params}
285 processor_outputs = unit.process(pipe, **processor_inputs)
286 inputs_shared.update(processor_outputs)
287 return inputs_shared, inputs_posi, inputs_nega

Callers

nothing calls this directly

Calls 2

processMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected