use anyhow::Result;
use rlx_core::flow_bridge::compile_options_from_profile;
use rlx_flow::{BuiltModel, CompileProfile};
use rlx_ir::logical_kernel::KernelDispatchConfig;
use rlx_runtime::{CompiledGraph, Device, Session};
pub fn llada2_profile() -> CompileProfile {
CompileProfile::llada2_diffusion()
}
pub fn compile_llada2_built(built: BuiltModel, device: Device) -> Result<CompiledGraph> {
let profile = built.profile().clone();
let (graph, params) = built.into_graph_parts()?;
let opts = compile_options_from_profile(&profile, device, KernelDispatchConfig::default());
let mut compiled = Session::new(device).compile_with(graph, &opts);
for (name, data) in params {
compiled.set_param(&name, &data);
}
Ok(compiled)
}