[Bugfix][Examples][MammothModa2] Serve T2I via LLM-typed DiT stage (#7199) + benchmark harness and profiler wiring (#7293)
Signed-off-by: quan-yi-ai <82917002+quan-yi-ai@users.noreply.github.com> Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
1 parent
b9cf74352a
commit
65f5a1d5b3
12 files changed
+933
-71
No files matched your search
@@ -2167,6 +2167,8 @@ async def generate_images(
|
||||
extra_body["system_prompt"] = request.system_prompt
|
||||
if request.return_stage_metrics is not None:
|
||||
extra_body["return_stage_metrics"] = request.return_stage_metrics
|
||||
for extra_key, extra_value in (request.model_extra or {}).items():
|
||||
extra_body.setdefault(extra_key, extra_value)
|
||||
|
||||
generation_result = await chat_handler.generate_diffusion_images(
|
||||
prompt=request.prompt,
|
||||
@@ -2426,18 +2428,20 @@ async def edit_images(
|
||||
# 3.0 Init with system default values
|
||||
app_state_args = getattr(raw_request.app.state, "args", None)
|
||||
default_sample_param = getattr(app_state_args, "default_sampling_params", None)
|
||||
# Currently only have one diffusion stage.
|
||||
diffusion_stage_ids = [i for i, cfg in enumerate(stage_configs) if get_stage_type(cfg) == "diffusion"]
|
||||
if not diffusion_stage_ids:
|
||||
# Image edits (img2img) remain gated to classical diffusion stages;
|
||||
# MammothModa2 is rejected at route level by its pipeline's endpoint
|
||||
# restrictions (test_mammoth_moda2_shared_runtime.py).
|
||||
image_stage_ids = [i for i, cfg in enumerate(stage_configs) if get_stage_type(cfg) == "diffusion"]
|
||||
if not image_stage_ids:
|
||||
raise HTTPException(
|
||||
status_code=HTTPStatus.SERVICE_UNAVAILABLE.value,
|
||||
detail="No diffusion stage found in multi-stage pipeline.",
|
||||
)
|
||||
diffusion_stage_id = diffusion_stage_ids[0]
|
||||
image_stage_id = image_stage_ids[0]
|
||||
apply_stage_default_sampling_params(
|
||||
default_sample_param,
|
||||
gen_params,
|
||||
str(diffusion_stage_id),
|
||||
str(image_stage_id),
|
||||
)
|
||||
_update_if_not_none(gen_params, "num_outputs_per_prompt", n)
|
||||
# 3.1 Parse per-request LoRA (compatible with chat's extra_body.lora shape).
|
||||
|
||||
Reference in new issue
Block a user