Embedding iris.c as a library + optional per-step trace for experiments?
Hi Salvatore
I'm using iris.c to learn diffusion internals by building a small scriptable experiment harness around it (out-of-tree: sweeps over steps/schedule/guidance/seed, contact sheets, image diffs, reproducible manifests). Right now it drives the CLI, and re-loading the model for every image makes sweeps painful.
Before writing code, I wanted to ask what you'd be comfortable with:
- A
libiristarget (static lib + a small embedding example) so the pipeline can be driven in-process. No behavior change, no new dependencies, C99 only. - An optional per-step callback in the sampler loop, compiled out by default, e.g.
iris_set_step_cb(ctx, cb, ud)giving(step, timestep). It would let external tools trace/benchmark and could also power a--traceCSV.
Both can be default-off and kept tiny. If you'd rather keep the core untouched, I'll keep everything in examples/ and just send bug reproductions and focused fixes I find with the harness.
Is either in scope? Happy to start with the smallest patch, or a docs-only example first if that's easier to evaluate.
Thanks.
@zhuzhonghua
make lib
just gives you that libiris.a static lib for en example on how to embed this you can look at
https://codeberg.org/ashimokawa/iris-gtk
Thanks @ashimokawa — I had missed make lib, and iris-gtk is a useful reference.
Also, my second ask turned out unnecessary: iris_set_step_image_callback()
already exists in iris.h, which is exactly what a scripted harness needs.
I've published mine out-of-tree here:
https://github.com/zhuzhonghua/iris.c-scheme