We have training for textual inversion in place: https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion. Might be worth adding one compatible with SDXL.