Skip to content

Instantly share code, notes, and snippets.

View cbensimon's full-sized avatar

Charles cbensimon

View GitHub Profile
@cbensimon
cbensimon / zerogpu-aoti-multi.py
Created September 1, 2025 14:14
Multi-compile + dispatch for ZeroGPU AoT compilation
@spaces.GPU
def compile():
with spaces.aoti_capture(pipe.transformer) as call_landscape:
pipe("prompt", width=832, height=480)
with spaces.aoti_capture(pipe.transformer) as call_portrait:
pipe("prompt", width=480, height=832)
exported_landscape = torch.export.export(model, args=call_landscape.args, kwargs=call_landscape.kwargs)
exported_portrait = torch.export.export(model, args=call_portrait.args, kwargs=call_portrait.kwargs)