[Model] Add Ming-flash-omni-2.0 Image Generation (Diffusion) Stage (#2875)
Signed-off-by: ZhengWG <zwg0606@gmail.com> Signed-off-by: Zheng Wengang <zwg0606@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Yuanheng Zhao <54058983+yuanheng-zhao@users.noreply.github.com>
This commit is contained in:
25 files changed
+2614
-42
No files matched your search
@@ -741,7 +741,10 @@ class Orchestrator:
|
||||
finished = output.finished
|
||||
submit_ts = req_state.stage_submit_ts.get(stage_id)
|
||||
|
||||
# CFG companion: stash output so parent can bundle [parent, *companions]
|
||||
# into source_outputs for the bridge (e.g. thinker2imagegen).
|
||||
if finished and self._cfg_tracker.is_companion(req_id):
|
||||
self._cfg_tracker.set_companion_output(req_id, output)
|
||||
await self._handle_cfg_companion_ready(req_id)
|
||||
await self._cleanup_request_ids([req_id])
|
||||
return
|
||||
@@ -933,12 +936,34 @@ class Orchestrator:
|
||||
requires_multimodal_data = getattr(next_client, "requires_multimodal_data", False)
|
||||
|
||||
if next_pool.stage_type == "diffusion":
|
||||
companion_outputs = self._cfg_tracker.pop_companion_outputs(req_id)
|
||||
expected = len(self._cfg_tracker.get_companion_request_ids(req_id))
|
||||
if expected > len(companion_outputs):
|
||||
logger.warning(
|
||||
"[Orchestrator] req=%s: only %d/%d CFG companion outputs arrived; "
|
||||
"downstream CFG conditioning may degrade",
|
||||
req_id,
|
||||
len(companion_outputs),
|
||||
expected,
|
||||
)
|
||||
diffusion_source_outputs = [output, *companion_outputs]
|
||||
if next_client.custom_process_input_func is not None:
|
||||
_t_ar2d = _time.perf_counter()
|
||||
diffusion_prompt = next_client.custom_process_input_func(
|
||||
source_outputs,
|
||||
_fn = next_client.custom_process_input_func
|
||||
_extra_kwargs: dict[str, Any] = {}
|
||||
# TODO: replace signature probe with explicit kwarg contract.
|
||||
try:
|
||||
import inspect as _inspect
|
||||
|
||||
if "sampling_params" in _inspect.signature(_fn).parameters:
|
||||
_extra_kwargs["sampling_params"] = params
|
||||
except (TypeError, ValueError):
|
||||
pass
|
||||
diffusion_prompt = _fn(
|
||||
diffusion_source_outputs,
|
||||
req_state.prompt,
|
||||
requires_multimodal_data,
|
||||
**_extra_kwargs,
|
||||
)
|
||||
_dt_ar2d = (_time.perf_counter() - _t_ar2d) * 1000
|
||||
req_state.pipeline_timings["ar2diffusion_ms"] = _dt_ar2d
|
||||
|
||||
Reference in new issue
Block a user