omnichar-core 1.3.24__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (578) hide show
  1. omnichar_core-1.3.24/.gitignore +24 -0
  2. omnichar_core-1.3.24/.python-version +1 -0
  3. omnichar_core-1.3.24/CLAUDE.md +383 -0
  4. omnichar_core-1.3.24/PKG-INFO +309 -0
  5. omnichar_core-1.3.24/README.md +237 -0
  6. omnichar_core-1.3.24/main.py +93 -0
  7. omnichar_core-1.3.24/pyproject.toml +182 -0
  8. omnichar_core-1.3.24/scripts/flux2_train_matrix.py +204 -0
  9. omnichar_core-1.3.24/scripts/minimax_h3_lora_check.py +145 -0
  10. omnichar_core-1.3.24/scripts/minimax_h3_train_matrix.py +206 -0
  11. omnichar_core-1.3.24/scripts/reference.py +65 -0
  12. omnichar_core-1.3.24/scripts/vendor_scalar.py +44 -0
  13. omnichar_core-1.3.24/src/inline_core/__init__.py +33 -0
  14. omnichar_core-1.3.24/src/inline_core/characters/__init__.py +35 -0
  15. omnichar_core-1.3.24/src/inline_core/characters/apply.py +311 -0
  16. omnichar_core-1.3.24/src/inline_core/characters/charfile.py +270 -0
  17. omnichar_core-1.3.24/src/inline_core/characters/encode.py +821 -0
  18. omnichar_core-1.3.24/src/inline_core/characters/library.py +159 -0
  19. omnichar_core-1.3.24/src/inline_core/characters/scoring.py +591 -0
  20. omnichar_core-1.3.24/src/inline_core/characters/sweep.py +282 -0
  21. omnichar_core-1.3.24/src/inline_core/characters/verify.py +194 -0
  22. omnichar_core-1.3.24/src/inline_core/characters/weights.py +99 -0
  23. omnichar_core-1.3.24/src/inline_core/components/__init__.py +1 -0
  24. omnichar_core-1.3.24/src/inline_core/components/conditioning.py +20 -0
  25. omnichar_core-1.3.24/src/inline_core/components/interfaces.py +91 -0
  26. omnichar_core-1.3.24/src/inline_core/config.py +120 -0
  27. omnichar_core-1.3.24/src/inline_core/device/__init__.py +1 -0
  28. omnichar_core-1.3.24/src/inline_core/device/auto.py +35 -0
  29. omnichar_core-1.3.24/src/inline_core/device/detect.py +199 -0
  30. omnichar_core-1.3.24/src/inline_core/device/memory.py +392 -0
  31. omnichar_core-1.3.24/src/inline_core/device/policy.py +171 -0
  32. omnichar_core-1.3.24/src/inline_core/device/probe.py +76 -0
  33. omnichar_core-1.3.24/src/inline_core/device/types.py +31 -0
  34. omnichar_core-1.3.24/src/inline_core/errors.py +42 -0
  35. omnichar_core-1.3.24/src/inline_core/extensions/__init__.py +10 -0
  36. omnichar_core-1.3.24/src/inline_core/extensions/api.py +214 -0
  37. omnichar_core-1.3.24/src/inline_core/extensions/constraints.py +181 -0
  38. omnichar_core-1.3.24/src/inline_core/extensions/fetch.py +196 -0
  39. omnichar_core-1.3.24/src/inline_core/extensions/handlers.py +144 -0
  40. omnichar_core-1.3.24/src/inline_core/extensions/importer.py +91 -0
  41. omnichar_core-1.3.24/src/inline_core/extensions/install.py +669 -0
  42. omnichar_core-1.3.24/src/inline_core/extensions/loader.py +285 -0
  43. omnichar_core-1.3.24/src/inline_core/extensions/manifest.py +361 -0
  44. omnichar_core-1.3.24/src/inline_core/extensions/models.py +58 -0
  45. omnichar_core-1.3.24/src/inline_core/extensions/paths.py +235 -0
  46. omnichar_core-1.3.24/src/inline_core/extensions/resolve.py +298 -0
  47. omnichar_core-1.3.24/src/inline_core/extensions/scanner.py +448 -0
  48. omnichar_core-1.3.24/src/inline_core/extensions/state.py +168 -0
  49. omnichar_core-1.3.24/src/inline_core/extensions/tools.py +138 -0
  50. omnichar_core-1.3.24/src/inline_core/ffmpeg.py +30 -0
  51. omnichar_core-1.3.24/src/inline_core/graph/__init__.py +1 -0
  52. omnichar_core-1.3.24/src/inline_core/graph/cache.py +138 -0
  53. omnichar_core-1.3.24/src/inline_core/graph/descriptor.py +88 -0
  54. omnichar_core-1.3.24/src/inline_core/graph/executor.py +114 -0
  55. omnichar_core-1.3.24/src/inline_core/graph/loader_runners.py +131 -0
  56. omnichar_core-1.3.24/src/inline_core/graph/primitives.py +160 -0
  57. omnichar_core-1.3.24/src/inline_core/graph/registry.py +97 -0
  58. omnichar_core-1.3.24/src/inline_core/graph/runners.py +90 -0
  59. omnichar_core-1.3.24/src/inline_core/graph/schema.py +161 -0
  60. omnichar_core-1.3.24/src/inline_core/graph/topo.py +49 -0
  61. omnichar_core-1.3.24/src/inline_core/graph/validate.py +56 -0
  62. omnichar_core-1.3.24/src/inline_core/media.py +11 -0
  63. omnichar_core-1.3.24/src/inline_core/models/__init__.py +8 -0
  64. omnichar_core-1.3.24/src/inline_core/models/catalog.py +260 -0
  65. omnichar_core-1.3.24/src/inline_core/models/character/__init__.py +9 -0
  66. omnichar_core-1.3.24/src/inline_core/models/character/finetune.py +202 -0
  67. omnichar_core-1.3.24/src/inline_core/models/character/runner.py +807 -0
  68. omnichar_core-1.3.24/src/inline_core/models/characterreqs.py +85 -0
  69. omnichar_core-1.3.24/src/inline_core/models/checkpoint.py +129 -0
  70. omnichar_core-1.3.24/src/inline_core/models/controlspace.py +26 -0
  71. omnichar_core-1.3.24/src/inline_core/models/flux1/__init__.py +1 -0
  72. omnichar_core-1.3.24/src/inline_core/models/flux1/provider.py +87 -0
  73. omnichar_core-1.3.24/src/inline_core/models/flux1/requirements.py +346 -0
  74. omnichar_core-1.3.24/src/inline_core/models/flux1/runner.py +477 -0
  75. omnichar_core-1.3.24/src/inline_core/models/flux1/variants.py +363 -0
  76. omnichar_core-1.3.24/src/inline_core/models/flux2/__init__.py +1 -0
  77. omnichar_core-1.3.24/src/inline_core/models/flux2/controlnet.py +234 -0
  78. omnichar_core-1.3.24/src/inline_core/models/flux2/embeds.py +165 -0
  79. omnichar_core-1.3.24/src/inline_core/models/flux2/provider.py +84 -0
  80. omnichar_core-1.3.24/src/inline_core/models/flux2/requirements.py +465 -0
  81. omnichar_core-1.3.24/src/inline_core/models/flux2/runner.py +760 -0
  82. omnichar_core-1.3.24/src/inline_core/models/flux2/variants.py +398 -0
  83. omnichar_core-1.3.24/src/inline_core/models/keymap.py +319 -0
  84. omnichar_core-1.3.24/src/inline_core/models/krea2/__init__.py +9 -0
  85. omnichar_core-1.3.24/src/inline_core/models/krea2/convert.py +138 -0
  86. omnichar_core-1.3.24/src/inline_core/models/krea2/depth_control.py +149 -0
  87. omnichar_core-1.3.24/src/inline_core/models/krea2/img2img.py +89 -0
  88. omnichar_core-1.3.24/src/inline_core/models/krea2/provider.py +68 -0
  89. omnichar_core-1.3.24/src/inline_core/models/krea2/requirements.py +254 -0
  90. omnichar_core-1.3.24/src/inline_core/models/krea2/runner.py +507 -0
  91. omnichar_core-1.3.24/src/inline_core/models/loaders.py +1783 -0
  92. omnichar_core-1.3.24/src/inline_core/models/lora.py +232 -0
  93. omnichar_core-1.3.24/src/inline_core/models/ltx25/__init__.py +18 -0
  94. omnichar_core-1.3.24/src/inline_core/models/ltx25/lora_keys.py +73 -0
  95. omnichar_core-1.3.24/src/inline_core/models/ltx25/memory.py +201 -0
  96. omnichar_core-1.3.24/src/inline_core/models/ltx25/pipeline.py +373 -0
  97. omnichar_core-1.3.24/src/inline_core/models/ltx25/provider.py +113 -0
  98. omnichar_core-1.3.24/src/inline_core/models/ltx25/requirements.py +462 -0
  99. omnichar_core-1.3.24/src/inline_core/models/ltx25/runner.py +400 -0
  100. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/__init__.py +38 -0
  101. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/__init__.py +0 -0
  102. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/allocator_trim_strategy.py +8 -0
  103. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/batch_split.py +105 -0
  104. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/block_streaming/__init__.py +20 -0
  105. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/block_streaming/block_fetcher.py +83 -0
  106. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/block_streaming/builder.py +500 -0
  107. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/block_streaming/disk.py +167 -0
  108. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/block_streaming/pool.py +71 -0
  109. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/block_streaming/provider.py +165 -0
  110. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/block_streaming/source.py +175 -0
  111. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/block_streaming/stream_sync.py +174 -0
  112. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/block_streaming/utils.py +169 -0
  113. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/block_streaming/wrapper.py +101 -0
  114. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/color/__init__.py +59 -0
  115. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/color/audio_mux.py +82 -0
  116. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/color/hlg.py +306 -0
  117. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/color/primaries.py +125 -0
  118. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/color/yuv.py +228 -0
  119. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/components/__init__.py +10 -0
  120. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/components/diffusion_steps.py +252 -0
  121. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/components/guiders.py +369 -0
  122. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/components/noisers.py +37 -0
  123. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/components/patchifiers.py +353 -0
  124. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/components/protocols.py +101 -0
  125. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/components/schedulers.py +130 -0
  126. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/conditioning/__init__.py +25 -0
  127. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/conditioning/exceptions.py +4 -0
  128. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/conditioning/item.py +20 -0
  129. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/conditioning/mask_utils.py +244 -0
  130. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/conditioning/types/__init__.py +19 -0
  131. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/conditioning/types/attention_strength_wrapper.py +71 -0
  132. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/conditioning/types/keyframe_cond.py +90 -0
  133. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/conditioning/types/keyframe_slots.py +174 -0
  134. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/conditioning/types/latent_cond.py +43 -0
  135. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/conditioning/types/mask_cond.py +49 -0
  136. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/conditioning/types/noise_mask_cond.py +45 -0
  137. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/conditioning/types/reference_audio_cond.py +65 -0
  138. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/conditioning/types/reference_video_cond.py +108 -0
  139. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/devices.py +112 -0
  140. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/duration_head/__init__.py +11 -0
  141. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/duration_head/duration_head.py +118 -0
  142. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/duration_head/model_configurator.py +35 -0
  143. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/guidance/__init__.py +15 -0
  144. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/guidance/perturbations.py +143 -0
  145. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/hdr.py +172 -0
  146. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/loader/__init__.py +66 -0
  147. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/loader/attention_ops.py +42 -0
  148. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/loader/fuse_loras.py +204 -0
  149. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/loader/helpers.py +95 -0
  150. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/loader/kernels.py +79 -0
  151. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/loader/module_ops.py +14 -0
  152. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/loader/primitives.py +176 -0
  153. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/loader/registry.py +147 -0
  154. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/loader/sd_ops.py +145 -0
  155. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/loader/sft_loader.py +77 -0
  156. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/loader/single_gpu_model_builder.py +294 -0
  157. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/modality_tiling.py +243 -0
  158. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/__init__.py +11 -0
  159. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/audio_vae/__init__.py +29 -0
  160. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/audio_vae/attention.py +71 -0
  161. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/audio_vae/audio_vae.py +509 -0
  162. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/audio_vae/causal_conv_2d.py +110 -0
  163. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/audio_vae/causality_axis.py +10 -0
  164. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/audio_vae/downsample.py +110 -0
  165. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/audio_vae/model_configurator.py +200 -0
  166. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/audio_vae/ops.py +75 -0
  167. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/audio_vae/resnet.py +176 -0
  168. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/audio_vae/upsample.py +106 -0
  169. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/audio_vae/vocoder.py +630 -0
  170. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/common/__init__.py +9 -0
  171. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/common/normalization.py +59 -0
  172. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/disposable.py +42 -0
  173. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/model_protocol.py +44 -0
  174. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/transformer/__init__.py +22 -0
  175. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/transformer/adaln.py +45 -0
  176. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/transformer/attention.py +579 -0
  177. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/transformer/compiling.py +239 -0
  178. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/transformer/cudagraph_capture.py +167 -0
  179. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/transformer/feed_forward.py +15 -0
  180. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/transformer/gelu_approx.py +10 -0
  181. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/transformer/modality.py +77 -0
  182. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/transformer/model.py +604 -0
  183. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/transformer/model_configurator.py +239 -0
  184. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/transformer/ops.py +106 -0
  185. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/transformer/rope.py +224 -0
  186. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/transformer/text_projection.py +38 -0
  187. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/transformer/timestep_embedding.py +143 -0
  188. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/transformer/transformer.py +447 -0
  189. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/transformer/transformer_args.py +411 -0
  190. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/upsampler/__init__.py +10 -0
  191. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/upsampler/blur_downsample.py +53 -0
  192. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/upsampler/model.py +143 -0
  193. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/upsampler/model_configurator.py +31 -0
  194. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/upsampler/pixel_shuffle.py +54 -0
  195. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/upsampler/res_block.py +37 -0
  196. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/upsampler/spatial_rational_resampler.py +47 -0
  197. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/__init__.py +54 -0
  198. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/attention.py +69 -0
  199. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/conv_video_decoder.py +557 -0
  200. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/convolution.py +317 -0
  201. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/diffusion_tiling.py +759 -0
  202. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/diffusion_video_decoder.py +748 -0
  203. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/enums.py +20 -0
  204. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/memory_efficient_decode.py +683 -0
  205. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/model_configurator.py +565 -0
  206. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/normalization.py +3 -0
  207. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/ops.py +84 -0
  208. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/resnet.py +277 -0
  209. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/sampling.py +123 -0
  210. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/__init__.py +107 -0
  211. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/apply.py +206 -0
  212. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/attention.py +174 -0
  213. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/blocks.py +83 -0
  214. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/chunked/__init__.py +1 -0
  215. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/chunked/attn.py +420 -0
  216. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/chunked/block.py +70 -0
  217. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/chunked/context.py +88 -0
  218. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/chunked/mlp.py +178 -0
  219. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/combined/__init__.py +1 -0
  220. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/combined/attn.py +123 -0
  221. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/combined/block.py +32 -0
  222. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/combined/context.py +21 -0
  223. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/combined/mlp.py +24 -0
  224. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/compiling.py +95 -0
  225. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/config.py +110 -0
  226. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/det_attn_rope.py +175 -0
  227. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/dsl_kernels/__init__.py +39 -0
  228. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/dsl_kernels/apply_dsl.py +111 -0
  229. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/dsl_kernels/attn.py +88 -0
  230. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/dsl_kernels/block.py +151 -0
  231. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/dsl_kernels/chain.py +79 -0
  232. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/fallback_na/__init__.py +154 -0
  233. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/fallback_na/eager.py +166 -0
  234. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/fallback_na/triton_na.py +181 -0
  235. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/layers.py +86 -0
  236. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/qkv.py +34 -0
  237. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/rope.py +109 -0
  238. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/rope_math.py +61 -0
  239. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/transformer/swiglu.py +479 -0
  240. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/model/video_vae/video_vae.py +637 -0
  241. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/multigpu/__init__.py +11 -0
  242. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/multigpu/gemma/__init__.py +6 -0
  243. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/multigpu/gemma/accelerate_wrapper.py +23 -0
  244. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/multigpu/gemma/batch_parallel_wrapper.py +71 -0
  245. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/multigpu/gemma/broadcast_wrapper.py +120 -0
  246. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/multigpu/gemma/loader.py +120 -0
  247. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/multigpu/sharded_sd.py +191 -0
  248. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/multigpu/transformer/__init__.py +13 -0
  249. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/multigpu/transformer/attention.py +270 -0
  250. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/multigpu/transformer/sequence_parallel.py +318 -0
  251. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/multigpu/transformer/tiled_data_parallel.py +99 -0
  252. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/multigpu/vae/__init__.py +5 -0
  253. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/multigpu/vae/distributed_decoder.py +318 -0
  254. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/quantization/__init__.py +17 -0
  255. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/quantization/blockwise/__init__.py +47 -0
  256. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/quantization/blockwise/_impl.py +433 -0
  257. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/quantization/fp8_cast.py +337 -0
  258. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/quantization/fp8_scaled_mm.py +203 -0
  259. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/quantization/nvfp4/__init__.py +64 -0
  260. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/quantization/nvfp4/convert.py +126 -0
  261. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/quantization/nvfp4/fuse.py +50 -0
  262. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/quantization/nvfp4/linear.py +139 -0
  263. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/quantization/nvfp4/prequant.py +207 -0
  264. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/quantization/nvfp4/types.py +13 -0
  265. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/quantization/policy.py +24 -0
  266. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/text_encoders/__init__.py +1 -0
  267. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/text_encoders/gemma/__init__.py +49 -0
  268. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/text_encoders/gemma/embeddings_connector.py +256 -0
  269. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/text_encoders/gemma/embeddings_processor.py +117 -0
  270. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/text_encoders/gemma/encoders/base_encoder.py +262 -0
  271. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/text_encoders/gemma/encoders/encoder_configurator.py +481 -0
  272. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/text_encoders/gemma/encoders/prompts/gemma3_i2v_system_prompt.txt +30 -0
  273. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/text_encoders/gemma/encoders/prompts/gemma3_t2v_system_prompt.txt +40 -0
  274. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/text_encoders/gemma/encoders/prompts/gemma4_i2v_system_prompt.txt +27 -0
  275. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/text_encoders/gemma/encoders/prompts/gemma4_t2v_system_prompt.txt +25 -0
  276. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/text_encoders/gemma/feature_extractor.py +129 -0
  277. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/text_encoders/gemma/gemma_assets.py +396 -0
  278. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/text_encoders/gemma/tokenizer.py +63 -0
  279. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/tiling.py +945 -0
  280. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/tools.py +280 -0
  281. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/types.py +300 -0
  282. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_core/utils.py +62 -0
  283. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/__init__.py +74 -0
  284. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/a2vid_two_stage.py +387 -0
  285. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/dfr_layout.py +213 -0
  286. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/dfr_pipeline.py +630 -0
  287. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/distilled.py +367 -0
  288. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/distilled_mgpu.py +233 -0
  289. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/dubit.py +401 -0
  290. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/hdr_ic_lora.py +987 -0
  291. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/ic_lora.py +540 -0
  292. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/iclora_utils.py +170 -0
  293. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/keyframe_interpolation.py +362 -0
  294. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/multigpu/__init__.py +31 -0
  295. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/multigpu/_broadcast.py +68 -0
  296. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/multigpu/bp_gemma_builder.py +90 -0
  297. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/multigpu/controller.py +382 -0
  298. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/multigpu/delegating_builder.py +91 -0
  299. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/multigpu/fleet.py +375 -0
  300. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/multigpu/gemma_builders.py +199 -0
  301. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/multigpu/nccl_groups.py +31 -0
  302. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/multigpu/runner.py +62 -0
  303. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/multigpu/sp_builder.py +62 -0
  304. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/multigpu/tdp_builder.py +75 -0
  305. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/multigpu/vae_builders.py +87 -0
  306. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/multigpu/weight_tracker.py +181 -0
  307. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/retake.py +397 -0
  308. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/t2a_one_stage.py +215 -0
  309. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/ti2vid_one_stage.py +311 -0
  310. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/ti2vid_two_stages.py +380 -0
  311. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/ti2vid_two_stages_hq.py +409 -0
  312. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/ti2vid_two_stages_hq_mgpu.py +278 -0
  313. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/ti2vid_two_stages_mgpu.py +279 -0
  314. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/__init__.py +57 -0
  315. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/args.py +1214 -0
  316. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/blocks.py +1236 -0
  317. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/constants.py +199 -0
  318. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/denoisers.py +361 -0
  319. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/gpu_model.py +34 -0
  320. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/helpers.py +585 -0
  321. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/media_io/__init__.py +76 -0
  322. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/media_io/color_config.py +103 -0
  323. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/media_io/decode.py +435 -0
  324. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/media_io/encode.py +302 -0
  325. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/media_io/exr.py +255 -0
  326. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/media_io/range_map.py +25 -0
  327. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/media_io/resize.py +143 -0
  328. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/model_paths.py +189 -0
  329. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/quantization_factory.py +50 -0
  330. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/res2s.py +62 -0
  331. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/samplers.py +707 -0
  332. omnichar_core-1.3.24/src/inline_core/models/ltx25/vendor/ltx_pipelines/utils/types.py +144 -0
  333. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/__init__.py +7 -0
  334. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/adaln.py +248 -0
  335. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/keys.py +158 -0
  336. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/load.py +448 -0
  337. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/lora_keys.py +235 -0
  338. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/nvfp4.py +201 -0
  339. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/pipeline.py +1083 -0
  340. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/provider.py +102 -0
  341. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/requirements.py +450 -0
  342. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/runner.py +622 -0
  343. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/vae_keys.py +125 -0
  344. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/vendor/__init__.py +46 -0
  345. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/vendor/autoencoder_kl_minimax_h3.py +922 -0
  346. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/vendor/autoencoder_kl_minimax_h3_audio.py +679 -0
  347. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/vendor/before_denoise.py +425 -0
  348. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/vendor/before_encoder.py +408 -0
  349. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/vendor/decoders.py +199 -0
  350. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/vendor/denoise.py +325 -0
  351. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/vendor/encoders.py +639 -0
  352. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/vendor/modular_blocks_minimax_h3.py +345 -0
  353. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/vendor/modular_pipeline.py +115 -0
  354. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/vendor/packing.py +538 -0
  355. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/vendor/packing_ref2va.py +841 -0
  356. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/vendor/scheduling_minimax_h3.py +288 -0
  357. omnichar_core-1.3.24/src/inline_core/models/minimaxh3/vendor/transformer_minimax_h3.py +644 -0
  358. omnichar_core-1.3.24/src/inline_core/models/offload.py +285 -0
  359. omnichar_core-1.3.24/src/inline_core/models/pipeline_runtime.py +848 -0
  360. omnichar_core-1.3.24/src/inline_core/models/prepared.py +151 -0
  361. omnichar_core-1.3.24/src/inline_core/models/preprocess/__init__.py +5 -0
  362. omnichar_core-1.3.24/src/inline_core/models/preprocess/requirements.py +59 -0
  363. omnichar_core-1.3.24/src/inline_core/models/preprocess/runner.py +174 -0
  364. omnichar_core-1.3.24/src/inline_core/models/references.py +125 -0
  365. omnichar_core-1.3.24/src/inline_core/models/registry_index.py +301 -0
  366. omnichar_core-1.3.24/src/inline_core/models/requirements.py +145 -0
  367. omnichar_core-1.3.24/src/inline_core/models/sampling.py +174 -0
  368. omnichar_core-1.3.24/src/inline_core/models/training/__init__.py +3 -0
  369. omnichar_core-1.3.24/src/inline_core/models/training/runner.py +239 -0
  370. omnichar_core-1.3.24/src/inline_core/models/trainingreqs.py +134 -0
  371. omnichar_core-1.3.24/src/inline_core/models/video_params.py +147 -0
  372. omnichar_core-1.3.24/src/inline_core/models/zimage/__init__.py +9 -0
  373. omnichar_core-1.3.24/src/inline_core/models/zimage/primitives.py +578 -0
  374. omnichar_core-1.3.24/src/inline_core/models/zimage/provider.py +73 -0
  375. omnichar_core-1.3.24/src/inline_core/models/zimage/requirements.py +348 -0
  376. omnichar_core-1.3.24/src/inline_core/models/zimage/runner.py +529 -0
  377. omnichar_core-1.3.24/src/inline_core/parallel/__init__.py +13 -0
  378. omnichar_core-1.3.24/src/inline_core/parallel/config.py +50 -0
  379. omnichar_core-1.3.24/src/inline_core/parallel/group.py +136 -0
  380. omnichar_core-1.3.24/src/inline_core/parallel/launch.py +44 -0
  381. omnichar_core-1.3.24/src/inline_core/parallel/protocol.py +53 -0
  382. omnichar_core-1.3.24/src/inline_core/parallel/registry.py +31 -0
  383. omnichar_core-1.3.24/src/inline_core/parallel/worker.py +75 -0
  384. omnichar_core-1.3.24/src/inline_core/runtime/__init__.py +1 -0
  385. omnichar_core-1.3.24/src/inline_core/runtime/context.py +38 -0
  386. omnichar_core-1.3.24/src/inline_core/runtime/file_store.py +81 -0
  387. omnichar_core-1.3.24/src/inline_core/runtime/progress.py +93 -0
  388. omnichar_core-1.3.24/src/inline_core/runtime/run.py +116 -0
  389. omnichar_core-1.3.24/src/inline_core/runtime/store.py +45 -0
  390. omnichar_core-1.3.24/src/inline_core/runtime/video_encode.py +211 -0
  391. omnichar_core-1.3.24/src/inline_core/sampling/__init__.py +1 -0
  392. omnichar_core-1.3.24/src/inline_core/sampling/batch.py +116 -0
  393. omnichar_core-1.3.24/src/inline_core/server/__init__.py +1 -0
  394. omnichar_core-1.3.24/src/inline_core/server/__main__.py +119 -0
  395. omnichar_core-1.3.24/src/inline_core/server/app.py +885 -0
  396. omnichar_core-1.3.24/src/inline_core/server/assets.py +58 -0
  397. omnichar_core-1.3.24/src/inline_core/server/bootstrap.py +169 -0
  398. omnichar_core-1.3.24/src/inline_core/server/docs.py +306 -0
  399. omnichar_core-1.3.24/src/inline_core/server/frontend.py +55 -0
  400. omnichar_core-1.3.24/src/inline_core/server/manager.py +276 -0
  401. omnichar_core-1.3.24/src/inline_core/server/reference.py +129 -0
  402. omnichar_core-1.3.24/src/inline_core/server/rpc.py +79 -0
  403. omnichar_core-1.3.24/src/inline_core/server/run_store.py +155 -0
  404. omnichar_core-1.3.24/src/inline_core/server/schemas.py +245 -0
  405. omnichar_core-1.3.24/src/inline_core/server/serialize.py +223 -0
  406. omnichar_core-1.3.24/src/inline_core/server/vendor/__init__.py +18 -0
  407. omnichar_core-1.3.24/src/inline_core/server/vendor/logo.svg +32 -0
  408. omnichar_core-1.3.24/src/inline_core/server/vendor/scalar.standalone.js +2455 -0
  409. omnichar_core-1.3.24/src/inline_core/server/version.py +215 -0
  410. omnichar_core-1.3.24/src/inline_core/studio/__init__.py +7 -0
  411. omnichar_core-1.3.24/src/inline_core/studio/activity.py +396 -0
  412. omnichar_core-1.3.24/src/inline_core/studio/assets.py +194 -0
  413. omnichar_core-1.3.24/src/inline_core/studio/characters.py +474 -0
  414. omnichar_core-1.3.24/src/inline_core/studio/config.py +28 -0
  415. omnichar_core-1.3.24/src/inline_core/studio/dataset_import.py +236 -0
  416. omnichar_core-1.3.24/src/inline_core/studio/fal.py +564 -0
  417. omnichar_core-1.3.24/src/inline_core/studio/finetune.py +632 -0
  418. omnichar_core-1.3.24/src/inline_core/studio/frames.py +565 -0
  419. omnichar_core-1.3.24/src/inline_core/studio/generation.py +342 -0
  420. omnichar_core-1.3.24/src/inline_core/studio/graph_build.py +402 -0
  421. omnichar_core-1.3.24/src/inline_core/studio/handlers.py +420 -0
  422. omnichar_core-1.3.24/src/inline_core/studio/image_meta.py +36 -0
  423. omnichar_core-1.3.24/src/inline_core/studio/models.py +494 -0
  424. omnichar_core-1.3.24/src/inline_core/studio/moodboard.py +576 -0
  425. omnichar_core-1.3.24/src/inline_core/studio/peaks.py +170 -0
  426. omnichar_core-1.3.24/src/inline_core/studio/recipe.py +282 -0
  427. omnichar_core-1.3.24/src/inline_core/studio/schema.py +436 -0
  428. omnichar_core-1.3.24/src/inline_core/studio/store.py +445 -0
  429. omnichar_core-1.3.24/src/inline_core/studio/system_stats.py +92 -0
  430. omnichar_core-1.3.24/src/inline_core/studio/timeline/__init__.py +6 -0
  431. omnichar_core-1.3.24/src/inline_core/studio/timeline/compose.py +130 -0
  432. omnichar_core-1.3.24/src/inline_core/studio/timeline/ffmpeg.py +76 -0
  433. omnichar_core-1.3.24/src/inline_core/studio/timeline/render.py +120 -0
  434. omnichar_core-1.3.24/src/inline_core/studio/timeline/resolve.py +197 -0
  435. omnichar_core-1.3.24/src/inline_core/studio/training.py +937 -0
  436. omnichar_core-1.3.24/src/inline_core/studio/training_store.py +358 -0
  437. omnichar_core-1.3.24/src/inline_core/studio/tuning_report.py +225 -0
  438. omnichar_core-1.3.24/src/inline_core/studio/workflows.py +193 -0
  439. omnichar_core-1.3.24/src/inline_core/takes.py +31 -0
  440. omnichar_core-1.3.24/src/inline_core/training/__init__.py +10 -0
  441. omnichar_core-1.3.24/src/inline_core/training/__main__.py +74 -0
  442. omnichar_core-1.3.24/src/inline_core/training/arch.py +621 -0
  443. omnichar_core-1.3.24/src/inline_core/training/cache.py +127 -0
  444. omnichar_core-1.3.24/src/inline_core/training/caption.py +177 -0
  445. omnichar_core-1.3.24/src/inline_core/training/dataset.py +373 -0
  446. omnichar_core-1.3.24/src/inline_core/training/h3.py +556 -0
  447. omnichar_core-1.3.24/src/inline_core/training/ltx25.py +364 -0
  448. omnichar_core-1.3.24/src/inline_core/training/models.py +803 -0
  449. omnichar_core-1.3.24/src/inline_core/training/precache_store.py +138 -0
  450. omnichar_core-1.3.24/src/inline_core/training/protocol.py +61 -0
  451. omnichar_core-1.3.24/src/inline_core/training/trainer.py +396 -0
  452. omnichar_core-1.3.24/tests/conftest.py +25 -0
  453. omnichar_core-1.3.24/tests/helpers.py +80 -0
  454. omnichar_core-1.3.24/tests/reference/lookalike_faces.json +91 -0
  455. omnichar_core-1.3.24/tests/test_api_docs.py +225 -0
  456. omnichar_core-1.3.24/tests/test_asset_uploads.py +178 -0
  457. omnichar_core-1.3.24/tests/test_bootstrap_without_torch.py +77 -0
  458. omnichar_core-1.3.24/tests/test_cache.py +116 -0
  459. omnichar_core-1.3.24/tests/test_catalog.py +205 -0
  460. omnichar_core-1.3.24/tests/test_character_nodes.py +893 -0
  461. omnichar_core-1.3.24/tests/test_character_requirements.py +131 -0
  462. omnichar_core-1.3.24/tests/test_characters_apply.py +249 -0
  463. omnichar_core-1.3.24/tests/test_characters_dir_upload.py +84 -0
  464. omnichar_core-1.3.24/tests/test_characters_encode.py +507 -0
  465. omnichar_core-1.3.24/tests/test_characters_library.py +155 -0
  466. omnichar_core-1.3.24/tests/test_characters_rpc.py +387 -0
  467. omnichar_core-1.3.24/tests/test_characters_scoring.py +560 -0
  468. omnichar_core-1.3.24/tests/test_characters_wiring.py +269 -0
  469. omnichar_core-1.3.24/tests/test_charfile.py +161 -0
  470. omnichar_core-1.3.24/tests/test_checkpoint.py +143 -0
  471. omnichar_core-1.3.24/tests/test_clip_grid_parity.py +68 -0
  472. omnichar_core-1.3.24/tests/test_config.py +84 -0
  473. omnichar_core-1.3.24/tests/test_dataset_import.py +128 -0
  474. omnichar_core-1.3.24/tests/test_device_detect.py +323 -0
  475. omnichar_core-1.3.24/tests/test_encoder_parking.py +94 -0
  476. omnichar_core-1.3.24/tests/test_executor.py +74 -0
  477. omnichar_core-1.3.24/tests/test_extension_api.py +210 -0
  478. omnichar_core-1.3.24/tests/test_extension_install.py +572 -0
  479. omnichar_core-1.3.24/tests/test_extension_manifest.py +184 -0
  480. omnichar_core-1.3.24/tests/test_extension_resolve.py +298 -0
  481. omnichar_core-1.3.24/tests/test_extension_scanner.py +291 -0
  482. omnichar_core-1.3.24/tests/test_extension_spine.py +98 -0
  483. omnichar_core-1.3.24/tests/test_extension_state.py +114 -0
  484. omnichar_core-1.3.24/tests/test_file_store.py +33 -0
  485. omnichar_core-1.3.24/tests/test_finetune_node.py +137 -0
  486. omnichar_core-1.3.24/tests/test_finetune_service.py +311 -0
  487. omnichar_core-1.3.24/tests/test_flux1_resolve.py +143 -0
  488. omnichar_core-1.3.24/tests/test_flux1_training.py +268 -0
  489. omnichar_core-1.3.24/tests/test_flux1_variants.py +153 -0
  490. omnichar_core-1.3.24/tests/test_flux2_controlnet.py +159 -0
  491. omnichar_core-1.3.24/tests/test_flux2_folder.py +179 -0
  492. omnichar_core-1.3.24/tests/test_flux2_resolve.py +212 -0
  493. omnichar_core-1.3.24/tests/test_flux2_runner.py +148 -0
  494. omnichar_core-1.3.24/tests/test_flux2_training.py +274 -0
  495. omnichar_core-1.3.24/tests/test_flux2_variants.py +198 -0
  496. omnichar_core-1.3.24/tests/test_frontend_serving.py +151 -0
  497. omnichar_core-1.3.24/tests/test_h3_characters.py +609 -0
  498. omnichar_core-1.3.24/tests/test_hidden_nodes.py +44 -0
  499. omnichar_core-1.3.24/tests/test_keymap.py +268 -0
  500. omnichar_core-1.3.24/tests/test_krea2_convert.py +157 -0
  501. omnichar_core-1.3.24/tests/test_krea2_depth_control.py +104 -0
  502. omnichar_core-1.3.24/tests/test_krea2_requirements.py +148 -0
  503. omnichar_core-1.3.24/tests/test_krea2_runner.py +165 -0
  504. omnichar_core-1.3.24/tests/test_loader_runners.py +83 -0
  505. omnichar_core-1.3.24/tests/test_loaders.py +131 -0
  506. omnichar_core-1.3.24/tests/test_lora.py +261 -0
  507. omnichar_core-1.3.24/tests/test_lora_download.py +105 -0
  508. omnichar_core-1.3.24/tests/test_ltx25_lora_keys.py +117 -0
  509. omnichar_core-1.3.24/tests/test_ltx25_nodes.py +201 -0
  510. omnichar_core-1.3.24/tests/test_ltx25_requirements.py +438 -0
  511. omnichar_core-1.3.24/tests/test_ltx25_training.py +220 -0
  512. omnichar_core-1.3.24/tests/test_ltx25_wired_refs.py +55 -0
  513. omnichar_core-1.3.24/tests/test_manager_queue.py +152 -0
  514. omnichar_core-1.3.24/tests/test_memory_policy.py +283 -0
  515. omnichar_core-1.3.24/tests/test_minimaxh3_adaln.py +166 -0
  516. omnichar_core-1.3.24/tests/test_minimaxh3_keys.py +138 -0
  517. omnichar_core-1.3.24/tests/test_minimaxh3_load.py +405 -0
  518. omnichar_core-1.3.24/tests/test_minimaxh3_lora_keys.py +249 -0
  519. omnichar_core-1.3.24/tests/test_minimaxh3_nodes.py +734 -0
  520. omnichar_core-1.3.24/tests/test_minimaxh3_nvfp4.py +220 -0
  521. omnichar_core-1.3.24/tests/test_minimaxh3_training.py +489 -0
  522. omnichar_core-1.3.24/tests/test_model_download_queue.py +205 -0
  523. omnichar_core-1.3.24/tests/test_model_registry_index.py +163 -0
  524. omnichar_core-1.3.24/tests/test_model_requirements.py +172 -0
  525. omnichar_core-1.3.24/tests/test_offload_prepared.py +233 -0
  526. omnichar_core-1.3.24/tests/test_output_kind_contract.py +67 -0
  527. omnichar_core-1.3.24/tests/test_parallel_group.py +51 -0
  528. omnichar_core-1.3.24/tests/test_pipeline_cache.py +82 -0
  529. omnichar_core-1.3.24/tests/test_precache_store.py +113 -0
  530. omnichar_core-1.3.24/tests/test_primitives.py +97 -0
  531. omnichar_core-1.3.24/tests/test_recipe.py +473 -0
  532. omnichar_core-1.3.24/tests/test_references.py +84 -0
  533. omnichar_core-1.3.24/tests/test_rpc_bridge.py +51 -0
  534. omnichar_core-1.3.24/tests/test_run_store.py +67 -0
  535. omnichar_core-1.3.24/tests/test_sampling.py +121 -0
  536. omnichar_core-1.3.24/tests/test_schema.py +52 -0
  537. omnichar_core-1.3.24/tests/test_schemas_contract.py +157 -0
  538. omnichar_core-1.3.24/tests/test_server.py +134 -0
  539. omnichar_core-1.3.24/tests/test_staged_residency.py +256 -0
  540. omnichar_core-1.3.24/tests/test_studio_activity.py +270 -0
  541. omnichar_core-1.3.24/tests/test_studio_assets.py +72 -0
  542. omnichar_core-1.3.24/tests/test_studio_fal.py +343 -0
  543. omnichar_core-1.3.24/tests/test_studio_frames.py +126 -0
  544. omnichar_core-1.3.24/tests/test_studio_generation.py +316 -0
  545. omnichar_core-1.3.24/tests/test_studio_graph_build.py +161 -0
  546. omnichar_core-1.3.24/tests/test_studio_models.py +110 -0
  547. omnichar_core-1.3.24/tests/test_studio_moodboard.py +138 -0
  548. omnichar_core-1.3.24/tests/test_studio_multi_reference.py +195 -0
  549. omnichar_core-1.3.24/tests/test_studio_node_size.py +58 -0
  550. omnichar_core-1.3.24/tests/test_studio_peaks.py +143 -0
  551. omnichar_core-1.3.24/tests/test_studio_rpc.py +150 -0
  552. omnichar_core-1.3.24/tests/test_studio_schema.py +269 -0
  553. omnichar_core-1.3.24/tests/test_studio_store.py +174 -0
  554. omnichar_core-1.3.24/tests/test_studio_timeline.py +119 -0
  555. omnichar_core-1.3.24/tests/test_studio_training.py +408 -0
  556. omnichar_core-1.3.24/tests/test_sweep.py +191 -0
  557. omnichar_core-1.3.24/tests/test_take_bytes.py +56 -0
  558. omnichar_core-1.3.24/tests/test_topo.py +30 -0
  559. omnichar_core-1.3.24/tests/test_training_arch.py +113 -0
  560. omnichar_core-1.3.24/tests/test_training_dataset.py +168 -0
  561. omnichar_core-1.3.24/tests/test_training_models.py +225 -0
  562. omnichar_core-1.3.24/tests/test_training_nodes.py +290 -0
  563. omnichar_core-1.3.24/tests/test_training_requirements.py +156 -0
  564. omnichar_core-1.3.24/tests/test_training_resolve.py +90 -0
  565. omnichar_core-1.3.24/tests/test_training_snapshots.py +68 -0
  566. omnichar_core-1.3.24/tests/test_validate.py +63 -0
  567. omnichar_core-1.3.24/tests/test_version_report.py +79 -0
  568. omnichar_core-1.3.24/tests/test_video_encode.py +181 -0
  569. omnichar_core-1.3.24/tests/test_video_params.py +114 -0
  570. omnichar_core-1.3.24/tests/test_webui_install.py +376 -0
  571. omnichar_core-1.3.24/tests/test_workflows_proxy.py +105 -0
  572. omnichar_core-1.3.24/tests/test_xfuser_sampler.py +88 -0
  573. omnichar_core-1.3.24/tests/test_zimage_primitives.py +321 -0
  574. omnichar_core-1.3.24/tests/test_zimage_resolve.py +158 -0
  575. omnichar_core-1.3.24/tests/test_zimage_runner.py +580 -0
  576. omnichar_core-1.3.24/uv.lock +2795 -0
  577. omnichar_core-1.3.24/webui.bat +507 -0
  578. omnichar_core-1.3.24/webui.sh +546 -0
@@ -0,0 +1,24 @@
1
+ # Model weights (gigabytes). The engine's models root - `models_dir()` defaults to ./models, and
2
+ # runners scan ./models/<category>/ (e.g. diffusion_models/). Leading slash anchors this to the repo
3
+ # root ONLY, so the source package src/inline_core/models/ (code) stays tracked.
4
+ /models/
5
+
6
+ # Engine working data: the run DB and generated takes (also grows to gigabytes).
7
+ /.inline/
8
+
9
+ # Installed community extensions - `extensions_dir()` defaults to ./extensions (state.json, the
10
+ # per-extension source/venv, and the .cache/git mirrors). Runtime data, never committed.
11
+ /extensions/
12
+
13
+ # Studio app data + project workspace (when created under the repo) and local server logs.
14
+ /.inline-studio-server/
15
+ /InlineStudioProjects/
16
+ *.log
17
+
18
+ # Python venv + bytecode
19
+ .venv/
20
+ __pycache__/
21
+ *.py[cod]
22
+
23
+ # Local env overrides
24
+ .env
@@ -0,0 +1 @@
1
+ 3.11
@@ -0,0 +1,383 @@
1
+ # Inline Core - Engineering Guide
2
+
3
+ Inline Core is the **generation engine behind Omnichar Studio** (the UI client). It
4
+ takes a **typed node graph (JSON)** and returns immutable renders ("takes"), running image and video
5
+ models across macOS, Windows, and Linux - from CPU-only boxes and low-VRAM laptops up to multi-GPU
6
+ machines that split a single image's sampling across GPUs (via xDiT). **It is the render backend that
7
+ replaces ComfyUI for Omnichar.**
8
+
9
+ > The UI client lives in the separate **Omnichar Studio** repo
10
+ > ([`omnichar/OmniChar`](https://github.com/omnichar/OmniChar)), which vendors this engine under
11
+ > `core/` via `git subtree`. It drives the engine over the `/v1` HTTP + websocket API; Inline Core is
12
+ > headless and knows nothing about the UI.
13
+
14
+ > **Naming:** the product has been renamed twice, Inline Studio then OpenChar Studio, and is now
15
+ > **Omnichar Studio**; this engine is still called **Inline Core**. That is deliberate: the PyPI package is `omnichar-core` but the
16
+ > import path is `inline_core`, because users and extensions already depend on it. Do not rename the
17
+ > module, the `INLINE_*` env vars, or the `.inlinestudio` project folders.
18
+
19
+ > **GitHub org: `omnichar`** - it moved `inlineresearch` -> `OpenCharAI` -> `omnichar`, and the old
20
+ > URLs 301-redirect, so a stale `git remote` still works. Never write an `inlineresearch/` or
21
+ > `OpenCharAI/` URL in anything new. Sibling repos: `OmniChar` (UI + this engine, formerly
22
+ > `Inline-Studio` then `OpenChar`), `Inline-Core` (this engine's own
23
+ > repo), `Inline-Registry` (the published extension index served to the Available tab),
24
+ > `Inline-Studio-Extension-Guide` (the reference extension). Only the org and the UI repo were
25
+ > renamed; the rest kept their `Inline-*` names.
26
+
27
+ > Read this file before changing code. It defines the architecture and the non-negotiable rules.
28
+ > `README.md` is the user/product-facing version of the same story; this is the engineering contract.
29
+
30
+ ## Mental model (everything is organised around this)
31
+
32
+ ```
33
+ Graph (typed nodes + edges) → Run → Take[] (immutable renders)
34
+ ```
35
+
36
+ - **Graph** - a JSON DAG of typed nodes. Edges are type-checked (`model`, `vae`, `conditioning`,
37
+ `latent`, media) **before** the run, so a bad graph is rejected at submit (422), never mid-denoise.
38
+ - **Run** - one execution of a target node's upstream closure. Durable (survives a restart) and
39
+ pollable; progress streams over a websocket.
40
+ - **Take** - one immutable output. Regenerating adds a take; **nothing is overwritten** (this mirrors
41
+ Omnichar Studio's frame/take model - the take history is the core value Comfy lacks).
42
+ - **Node** - has a **descriptor** (the data half: ports, params, file pickers - served at
43
+ `/v1/models`) and a **runner** (the behavior half). A descriptor with no runner is served and
44
+ type-checked but cannot execute yet.
45
+
46
+ ### The two boundaries that matter most (why this isn't ComfyUI)
47
+
48
+ 1. **Graph orchestration is decoupled from GPU work.** The executor runs cheap orchestration inline
49
+ and never runs the denoise loop itself - a model runner submits a `SampleJob` through the
50
+ **batched-sampler seam** (`sampling/batch.py`). The graph is the unit of caching; the sampler is
51
+ the unit of batching; the multi-GPU split routes through that same seam.
52
+ 2. **The device policy is the single owner of placement.** No node or component ever picks a device,
53
+ dtype, or offload. They ask `DevicePolicy.placement(role)`. So the same graph runs on a 4090, a
54
+ 6 GB laptop, pure CPU, or split across several GPUs, without touching the graph.
55
+
56
+ If you find yourself hardcoding a device in a component, or running a denoise loop inside the
57
+ executor, stop - you're breaking one of the two boundaries the whole design exists to keep.
58
+
59
+ ## Architecture
60
+
61
+ Headless Python. A FastAPI `/v1` server over a run manager, a node registry, and a device policy.
62
+
63
+ ```
64
+ HTTP/WS → server/app.py → RunManager → Executor → Registry (descriptor + runner)
65
+
66
+ runner "lowers" to → components (TextEncoder/Denoiser/VAE/…)
67
+
68
+ SampleJob → BatchedSampler (inline | xDiT worker group)
69
+ ```
70
+
71
+ - **`server/`** - the `/v1` API. `app.py` (routes), `manager.py` (validate → queue → run on a worker
72
+ thread → fan out events), `run_store.py` (SQLite durability), `bootstrap.py` (best-effort model
73
+ registration), `serialize.py` (contract JSON), `assets.py` (content-addressed upload).
74
+ - **`graph/`** - the engine core. `schema.py` (typed `Graph`/`Node`/`Edge` + JSON parser),
75
+ `descriptor.py` (node data half), `runners.py` (node behavior half + source nodes), `registry.py`
76
+ (descriptors + runners), `validate.py` + `topo.py` (type-check + order), `executor.py` (lazy
77
+ closure execution, node cache), `primitives.py` (the low-level node vocabulary), `cache.py`.
78
+ - **`components/`** - the five device-agnostic component interfaces (`TextEncoder`, `Scheduler`,
79
+ `Denoiser`, `Sampler`, `VAE`) plus opaque `Conditioning`/`Latents`. Placement comes from the ctx.
80
+ - **`sampling/`** - `batch.py`: the graph/GPU boundary. `SampleJob` → `BatchedSampler`
81
+ (`InlineBatchedSampler` today; `XFuserBatchedSampler` routes a parallel placement to the worker
82
+ group). Keep this module torch-free and mockable.
83
+ - **`device/`** - the policy. `policy.py` (interface: `Placement`, `Profile`, quant, attention),
84
+ `memory.py` (`MemoryPolicy`), `detect.py` / `auto.py` (enumerate GPUs, NVLink vs PCIe), `types.py`.
85
+ - **`parallel/`** - the xDiT (xfuser) worker group: one process per GPU via `torchrun`, talking over
86
+ local IPC behind the sampler seam. `launch.py`, `worker.py`, `group.py`, `registry.py`, `config.py`,
87
+ `protocol.py`. The HTTP server, DB, and graph stay single-process; only the denoise distributes.
88
+ - **`models/`** - `catalog.py` (scans the models root, feeds `options_from` selects + the registry
89
+ version) and the **model-runner subpackages** (e.g. `zimage/`), imported best-effort by
90
+ `server/bootstrap.py` so a torch-less install still boots.
91
+ - **`runtime/`** - `context.py` (`ExecutionContext`, `CancelToken`), `run.py` (`RunState`),
92
+ `progress.py` (events + emitters), `store.py` / `file_store.py` (`TakeStore`: owns take bytes/hash/
93
+ uri).
94
+ - **`config.py`** - all env config, small and explicit. **`takes.py`**, **`media.py`**, **`errors.py`**
95
+ - domain primitives (`Take`/`AssetRef`, `MediaKind`, the error hierarchy).
96
+
97
+ ### Node vocabularies (three, and their status)
98
+
99
+ - **Source nodes** (`graph/runners.py`) - `input/text`, `input/image`. Runners exist; pure, no takes.
100
+ These are the closure boundary: the UI feeds curated inputs in as source nodes so nothing upstream
101
+ is recomputed.
102
+ - **Low-level primitives** (`graph/primitives.py`) - `load/diffusion-model`, `load/vae`,
103
+ `load/text-encoder`, `encode/text`, `latent/empty`, `sample`, `vae/decode`, `vae/encode`. These are
104
+ the ComfyUI-equivalent decomposed graph and the intended long-term surface. **Descriptor-only
105
+ today - their runners land in C2.** A graph built from them validates and type-checks but raises
106
+ `No runner registered` at execution.
107
+ - **Model runners** (`models/<name>/`) - high-level single generation nodes. **`black-forest-labs/flux-2`
108
+ (`models/flux2/`) is the reference for a _family_:** one node covers klein 4B/9B, their base builds,
109
+ the KV variant and dev, because the picked checkpoint is identified from its own tensor shapes
110
+ (`flux2/variants.py`) and everything else follows. Adding a checkpoint is a row in that table.
111
+ Two rules it establishes: **identify a checkpoint by content, never by filename** (`diffusion_models/`
112
+ is shared across architectures, and Qwen3-4B and Qwen3-VL-4B have byte-identical embedding shapes),
113
+ and **derive geometry from the checkpoint** rather than bundling a config per variant, so a future
114
+ build loads with no code change. A **diffusers folder** is a valid checkpoint too, which is the only
115
+ way a 32B model reaches a 24 GB card: its NF4 shards stream through `from_pretrained`, where
116
+ `from_single_file` cannot quantize at all. **`alibaba/z-image-turbo`
117
+ (`models/zimage/`) is the one runnable generation path today** (prompt + optional image → one take,
118
+ backed by diffusers' `ZImagePipeline`/`ZImageImg2ImgPipeline`). This is the "Z-Image pipeline that
119
+ already works" - the primitives will reach parity in C2. It loads from a **single diffusion
120
+ `.safetensors`** (drop one file in `diffusion_models/`, ComfyUI-style - no repo folder to set up):
121
+ the runner loads the transformer via `from_single_file` and pulls the VAE / text-encoder / tokenizer
122
+ from the reference repo behind the scenes, so the user only ever handles one model file.
123
+ - **Low-level primitives and source nodes are `hidden`** (`NodeDescriptor.hidden`): they are served for
124
+ validation/execution but never offered in the UI's add-node menu. Generation stays one-click - the
125
+ user sees only high-level model nodes; loaders/VAE/encoders are wired up behind them.
126
+
127
+ Only media-output nodes (`vae/decode`, a model runner) become Frames with take history; the engine
128
+ handles (`model`, `vae`, `text-encoder`, `conditioning`, `latent`) are opaque typed sockets passed
129
+ between nodes and are never takes.
130
+
131
+ ### Storage & configuration (all env, see `config.py`)
132
+
133
+ - **Never put weights on an instance's ephemeral/scratch disk.** On cloud GPU boxes (`/opt/dlami/nvme`,
134
+ `/mnt/resource`, and anything else labelled ephemeral or instance-store) the volume is **wiped on
135
+ every stop/start**, taking the models and leaving dangling symlinks in `models/`. This has cost two
136
+ full re-downloads of MiniMax H3 at ~130 GB each. Weights go on the persistent root volume, or on an
137
+ attached volume that survives a restart. Scratch is fine for logs and temporary output only.
138
+ - **`huggingface_hub>=0.32`** - below it `hf_xet` is only an extra, and files over ~50GB (every
139
+ H3 transformer) refuse to download at all.
140
+ - **Models root** - `INLINE_MODELS_DIR`, else `./models`. **Bring your own weights; nothing is
141
+ downloaded.** ComfyUI-style category subfolders (`diffusion_models/`, `vae/`, `text_encoders/`,
142
+ `loras/`, `controlnet/`, `checkpoints/`, `clip_vision/`, `upscale_models/`, `embeddings/`). The
143
+ catalog scans this on start; a file dropped in bumps the registry version so clients refetch
144
+ `/v1/models`. A model may be a single weight file or a folder (e.g. a diffusers snapshot or a
145
+ sharded text encoder).
146
+ - **Data dir** - `INLINE_DATA_DIR`, else `./.inline`. Engine-owned working data: `runs.db` (durable
147
+ runs) and `takes/` (output bytes).
148
+ - **Asset store** - `INLINE_ASSET_DIR`, else `./.inline-assets`. Content-addressed uploads from
149
+ `POST /v1/assets`. A graph names one as `{"ref": "asset", "id": ...}` on an `input/image` or
150
+ `input/video` node and the server rewrites it to that file at submit, because every reader opens a
151
+ path; an id the store does not hold is a 422, never a mid-run failure.
152
+ - **Characters dir** - `INLINE_CHARACTERS_DIR`, else `<models root>/characters`. Where `.char` files
153
+ are written, and searched first when one is resolved. Point it off a shared models root (a cloud
154
+ worker's pod disk) so one user's characters are not everyone's. The `/v1/models` picker still
155
+ scans only the models roots.
156
+ - **Run data dir** - `INLINE_RUN_DATA_DIR`, else the data dir. Takes, `runs.db`, the character
157
+ payload cache and FLUX.2 prompt embeddings: everything built from what a run was given. Point it
158
+ off a shared data dir, which a cloud volume keeps for its fetched model configs.
159
+ - **Trained LoRAs dir** - `INLINE_TRAINED_LORAS_DIR`, else `<models root>/loras`. Where a finished
160
+ training run and an exported snapshot are written. When set, the run records the absolute path,
161
+ which every reader joins onto the models root unchanged. Point it off a shared models root for the
162
+ same reason as characters; a LoRA written there is then not in the loader dropdown.
163
+ - **Server bind** - `INLINE_HOST` (default `127.0.0.1`), `INLINE_PORT` (default `8848`).
164
+ - **Model overrides** - e.g. `INLINE_ZIMAGE_MODEL` (a single `.safetensors` file path, a local
165
+ diffusers dir, or a HF repo id for Z-Image). Auto-resolved from `diffusion_models/` when unset.
166
+ - **Memory** - by default prefer the GPU, and **auto-fit the model to it**. When a runner hands the
167
+ policy the model's on-disk sizes (`DevicePolicy.set_footprint`, a `ModelFootprint`), the policy sizes
168
+ the weights against total VRAM (minus an activation headroom) and picks the lightest plan that fits:
169
+ full-precision **resident** → else int8 **resident** (torchao halves the transformer + text encoder,
170
+ no CPU offload - int8 + accelerate's `enable_model_cpu_offload` deadlock together) → else unquantized
171
+ `SEQUENTIAL` submodule streaming. So a card that can't hold Z-Image full-precision (a T4)
172
+ **auto-int8s with no flag**; `set_footprint(None)` / an unsizable whole-pipeline folder falls back to
173
+ the coarse total-VRAM buckets. Capacity is TOTAL VRAM (a fixed device property), not live-free, so the
174
+ plan - and the pipeline cache key it feeds - is stable across runs. The runner does a **pre-flight
175
+ check** (`DevicePolicy.fit_estimate`): a model too big for VRAM+RAM fails with a clean node error
176
+ before any load, instead of a host-RAM OOM-kill that would take the shared server down. Weights stream
177
+ straight to the GPU on load (`device=`/`device_map` in `models/loaders.py`) so peak host RAM ≈ one
178
+ tensor, and switching checkpoints **evicts** the previous model (`loaders.unload_components`,
179
+ `_evict_stale`) rather than stacking. `webui.sh` always sets `PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True`
180
+ to cut fragmentation OOMs. **Smart memory** (`INLINE_SMART_MEMORY=1`, `--smart-memory`) and
181
+ `INLINE_ALLOW_CPU_OFFLOAD=1` remain as explicit overrides when no footprint is set.
182
+ - **Compute dtype** - bf16 on the GPU by default, but **fp16 on cards without bf16 acceleration**
183
+ (Turing/Volta - compute capability < 8.0, e.g. a T4): same footprint, but it uses the fp16 tensor
184
+ cores instead of bf16's slow path. The **VAE stays upcast** (bf16, or fp32 when the denoiser is
185
+ fp16) because fp16 VAE decode can overflow to black/NaN images (`_compute_dtype` in `device/`).
186
+ - **Quantization rungs** - the fit ladder is full-precision resident → int8 resident → **NF4 resident**
187
+ → sequential offload → wont-fit. NF4 is what makes a 32B model viable on a 24 GB card. Note int8
188
+ forces bf16 (torchao's weight-only int8 silently no-ops under fp16) while NF4 does not, so a Turing
189
+ card keeps its fp16 tensor cores under NF4.
190
+ - **A pre-reduced checkpoint must not be re-reduced, structurally or numerically.** MiniMax H3's
191
+ `pruned` builds ship the AdaLN branch already factorised to rank 8 and drop the timestep path
192
+ entirely, so re-running our factorisation multiplies a `[96768, 8]` projection by a full-width
193
+ basis. `minimaxh3/pipeline.py` turns `factorise_adaln` off for those, the same way the rule below
194
+ turns quantization off for a prequantized file. Both are the same rule: the source is already in
195
+ the target form.
196
+ - **Size a checkpoint by what it becomes, not by what it weighs.** A pruned file has already lost
197
+ its AdaLN branch and an fp8 file stores half the bytes it will occupy once dequantised, so scaling
198
+ the on-disk number under-sizes both, by up to 3x. `minimaxh3.requirements.resident_bytes` counts
199
+ from the header. Under-sizing is the dangerous direction: the fit ladder then promises a machine
200
+ that dies to a host-RAM OOM kill instead of raising.
201
+ - **Prequantized checkpoints must not be re-quantized.** A checkpoint that ships already quantized
202
+ (`flux2/variants.is_prequantized`) has an on-disk size that already _is_ its resident size, so the
203
+ ladder's assumption that quantization halves it does not hold, and handing diffusers a second,
204
+ different quantization config is a hard error. Pass `Quantization.NONE` for those.
205
+ - **Staged loading** - when the text encoder and the transformer cannot be co-resident (dev is a
206
+ 15 GB encoder beside an 18 GB transformer), the prompt is encoded first and the encoder freed before
207
+ the transformer loads. The decision has to be made _before_ the load: by the time an OOM fires there
208
+ is nothing left to free.
209
+ - **Multi-GPU** - `INLINE_PARALLEL` (e.g. `pipefusion=2`, `pipefusion=2,ulysses=2`); degrees multiply
210
+ to the world size, which must equal the GPU count.
211
+
212
+ ### The `/v1` API (the contract with Omnichar Studio)
213
+
214
+ - `POST /v1/runs {graph, target}` → `{runId}` (validated up front; 422 on a bad graph, 409 on a
215
+ reused `clientRunId` with a different graph).
216
+ - `GET /v1/runs/{id}` → durable run state. `DELETE /v1/runs/{id}` cancels.
217
+ - `GET /v1/runs/{id}/events` (websocket) → a `snapshot`, then `progress` / `node_done` / `run_done`.
218
+ - `GET /v1/models` → node descriptors + `registryVersion` (ETag-aware; folds in the model-file scan).
219
+ - `GET /v1/models/{type}`, `GET /v1/takes/{id}`, `GET /v1/takes/{id}/bytes`, `POST /v1/assets`,
220
+ `GET /v1/health`.
221
+
222
+ Errors are `{error: {code, message, nodeId?}}` with the right HTTP status - they never leak a raw
223
+ traceback. The JSON shapes live in `server/serialize.py`.
224
+
225
+ ## Multi-GPU (xDiT): split one image across GPUs
226
+
227
+ One image's **denoise loop** (the expensive part) runs collectively across GPUs - not "one image per
228
+ GPU". It's done with xfuser in an isolated worker group (one process per GPU via `torchrun`, over
229
+ local IPC) behind the `XFuserBatchedSampler` seam. Single-GPU/CPU runs take the in-process path and
230
+ pay no overhead. Split method is chosen from the detected interconnect: **PipeFusion** (default, PCIe)
231
+ or **Ulysses** (NVLink). The policy and IPC round-trip are in place and tested with a stub worker; the
232
+ real xfuser denoise lands with the GPU-side runner (C2). Keep `sampling/batch.py` torch-free - the
233
+ real codec that moves tensors lives with the model runner.
234
+
235
+ ## Code standards (non-negotiable)
236
+
237
+ - **Typed, strict.** `pyright` in strict mode (`[tool.pyright]`, `typeCheckingMode = "strict"`), all of
238
+ `src` + `tests`. No silent `Any` leaks across component/graph boundaries.
239
+ - **Comments are one line.** Not two, not a paragraph, and only for the **why** a reader can't infer
240
+ from the code - a non-obvious constraint, a rejected alternative, an ordering that matters. Module
241
+ docstrings: one sentence. Function docstrings: one line, or none when the signature says it.
242
+ Never narrate what the code does, never write an essay in a docstring, never leave a comment that
243
+ restates the line below it. If the reasoning genuinely needs more, it belongs in a doc, not in
244
+ the source.
245
+ - **Lint.** `ruff` with `select = ["E", "F", "I", "UP", "B"]`, line length 100, target `py311`.
246
+ - **Typed graph, validated before run.** Never execute an unvalidated graph. Edge type-checking
247
+ (`graph/validate.py` + `port_satisfies`) rejects bad wiring at submit. New port kinds go in
248
+ `schema.py`.
249
+ - **Device policy owns placement.** Components and runners **never** self-assign a device/dtype/
250
+ offload - they call `ctx.policy.placement(role)` (`text_encoder`, `denoiser`, `vae`, …). This is the
251
+ rule that keeps one graph portable across GPU / low-VRAM / CPU / multi-GPU. The policy **prefers the
252
+ GPU**: a low-VRAM GPU keeps weights resident (tiling/slicing/int8 do the saving) and does not
253
+ auto-offload to CPU (`placement.offload` defaults False; opt in with `INLINE_ALLOW_CPU_OFFLOAD`).
254
+ - **Graph never runs the denoise inline.** A model runner lowers to components and submits a
255
+ `SampleJob` through the batched-sampler seam. The executor orchestrates; it does not sample.
256
+ - **Immutable takes.** The `TakeStore` owns bytes/hash/uri; regenerating adds a take. Never overwrite.
257
+ - **Engine deps are optional and import-guarded.** Heavy deps (torch, diffusers, xfuser) live in
258
+ `[project.optional-dependencies]` extras (`runtime`, `server`, `parallel`, `dev`). **`runtime` is
259
+ the single shared ML stack - a new model must reuse it, never declare its own torch/diffusers
260
+ block.** Model-runner
261
+ subpackages import torch/diffusers at module top **on purpose**: an absent extra makes the import
262
+ raise, and `server/bootstrap.py` skips that model best-effort so a core install still boots and
263
+ serves source nodes. Never import a heavy dep at package top level outside a runner subpackage.
264
+ - **Engine isolation.** All xDiT/worker knowledge lives behind `parallel/` and the sampler seam.
265
+ Don't scatter it.
266
+ - **Bring-your-own models.** Nothing is downloaded by the engine. The catalog scans; the user places
267
+ files. A model picker is a `SELECT` param with `options_from="<category>"`.
268
+ - **Adapter strength is not a quality metric, and a threshold on it is a false-positive machine.**
269
+ Measured against real bases, published LoRAs that work well span `|B@A| / |W|` from 0.017%
270
+ (a style LoRA) to 1.2% (a restoration LoRA), so "this adapter looks weak" is not a finding. What
271
+ predicts a LoRA doing nothing is whether its per-weight change clears one quantization step. Warn
272
+ on that, and only when the base is actually quantized.
273
+ - **Patching a diffusers object may patch a copy, and it will not tell you.**
274
+ `ModularPipeline.blocks` is a property returning `deepcopy(self._blocks)`, so hooking the block
275
+ graph through it installs cleanly onto a throwaway and reports success. That is how H3's denoise
276
+ ran with no per-step progress while the hook said it was attached. Reach for the backing
277
+ attribute, and prove a hook fires against the real object rather than trusting a return value.
278
+ - **Verify image models by rendering.** The FLUX.2 work shipped five bugs past a green test suite,
279
+ and every one produced a _wrong image rather than an error_: a mis-keyed checkpoint, a
280
+ vision-language encoder loaded in place of a text one, an unnormalized latent, and a control context
281
+ cast to a quantized weight's `uint8` storage dtype. A unit test cannot see a plausible-but-wrong
282
+ image. Render something and look at it.
283
+ - **Launchers are twins.** `webui.sh` and `webui.bat` change together; only the `launcher` CI job
284
+ can prove the `.bat`, since it cannot run on a dev box.
285
+ - **Match CUDA arches by within-major compatibility, never exactly.** An `sm_8x` cubin runs on any
286
+ `sm_8y` where `y >= x`, so `sm_86` covers Ada's `sm_89`.
287
+ - **Pass the widest `uv` flag that works.** `--no-sources-package` needs uv 0.10+; `--no-sources`
288
+ works back to 0.4 and means the same while torch is the only `[tool.uv.sources]` entry.
289
+ - **An explicit user setting beats a heuristic.** Test `on`/`off` before any auto rule, or the
290
+ control is silently dead for whichever arch the rule excludes.
291
+ - **Report a phase before the slow work, not after.** Progress emitted only on completion makes a
292
+ slow step look like a hung previous phase.
293
+ - **In a `.bat`, `call` anything that might be a `.bat`.** `nvidia-smi` is sometimes a shim, and
294
+ without `call` it takes over the script and never returns.
295
+ - **Log allocated AND reserved VRAM.** `nvidia-smi` shows only reserved, so allocator cache and a
296
+ leaked reference look identical from outside.
297
+ - **Tests (pytest).** Cover the logic that matters: graph validate/topo/executor/cache, the catalog
298
+ scan, the run store + server contract, the device/memory policy, the parallel group + xfuser seam,
299
+ and each model runner (import-guarded, no GPU needed). See `tests/`.
300
+ - **Commits.** Conventional Commits (`feat:`, `fix:`, `chore:`), small and scoped.
301
+
302
+ ## Commands
303
+
304
+ ```
305
+ uv venv # create ./.venv
306
+ # --python pins the target: without it uv installs into an activated venv/conda env, not ./.venv
307
+ uv pip install --python .venv/bin/python -e ".[server,dev]" # engine + server + test tooling
308
+ uv pip install --python .venv/bin/python -e ".[runtime]" # + torch, diffusers, transformers
309
+ uv pip install --python .venv/bin/python -e ".[runtime,parallel]" # + xfuser, multi-GPU denoise
310
+
311
+ ./webui.sh # run (loopback:8848); friendly flags → INLINE_* env
312
+ ./webui.sh --listen --port 9000 # bind all interfaces
313
+ ./webui.sh --lowvram # tight-VRAM profile
314
+ ./webui.sh --install --extra runtime # set up ./.venv with the model runtime, then exit
315
+ # (reuses an existing ./.venv; --recreate rebuilds it, and
316
+ # an activated foreign env is reported, never modified)
317
+ python -m inline_core.server # run the server directly (INLINE_HOST / INLINE_PORT)
318
+
319
+ ruff check . # lint (zero warnings)
320
+ uv run pytest -q # tests (no GPU; model code is import-guarded)
321
+ ```
322
+
323
+ ## Where to add things
324
+
325
+ - **New video model** → do **not** rediscover the plumbing; it exists as shared seams, and
326
+ `models/minimaxh3/` is the reference caller:
327
+ - `runtime/video_encode.py` + `TakeStore.save_video` / `save_audio` - frames plus a waveform to one
328
+ playable MP4. A model that generates video and its soundtrack jointly returns **both** takes;
329
+ only the one matching the descriptor's `output_kind` claims the node's canvas slot (see
330
+ `studio/generation._save_take`, and `tests/test_output_kind_contract.py` which keeps the
331
+ declarations honest).
332
+ - `models/video_params.py` - `VideoGrid` + `video_param_fields(...)`, the way
333
+ `sampling_param_fields(...)` already works. A duration snaps **up** onto the model's frame grid
334
+ and is then clamped into the model's window, which is what both reference implementations do:
335
+ asking H3 for 10 seconds gives 10.125, not 9.417. **fps is a model constant, never a param**,
336
+ or it desyncs from the grid.
337
+ - `models/references.py` - wired image/video/audio ports as one ordered, numbered list. Wiring
338
+ order is what the prompt addresses, so it is meaning, not decoration.
339
+ - `models/keymap.py` - load a checkpoint written for another implementation. Declare a key plan
340
+ (rename / split / swap halves / drop / assert-equal) and apply it while weights stream in. The
341
+ transforms it performs are the ones that fail **silently**, so a plan declares its expected row
342
+ layout and the detector measures the real one. It needs the **whole tensor**: one head's worth of
343
+ rows cannot tell the layouts apart, and it raises rather than guessing.
344
+ - `models/prepared.py` - cache a quantised model once. Everything that changes the bytes goes in
345
+ the hash, including model-specific flags, or switching a flag serves a stale artifact.
346
+ - `models/offload.py` - the device policy's plan to a concrete torchao + group-offload recipe,
347
+ plus **split residency**: group offload holds the whole model in host RAM, so a model bigger
348
+ than the RAM available has nowhere to sit and the kernel swaps it. `blocks_to_place` sizes the
349
+ overflow and those leading blocks go on the accelerator instead, placed as they land rather
350
+ than after the load. It moves the minimum, because every block left resident is VRAM the
351
+ render wanted for activations.
352
+ - **A group-offloaded model's host footprint is reclaimable at load and unreclaimable one step
353
+ later, so never size a split from free memory during the load.** Streaming from a safetensors
354
+ mmap leaves the CPU-side weights as clean file-backed pages the kernel can drop and re-read for
355
+ free. The first denoising step ends that: group offload returns each block with
356
+ `module.to("cpu")`, which allocates fresh anonymous memory and drops the file-backed storage.
357
+ A planner reading `available` mid-load is reading a number that is about to stop being true,
358
+ and the failure mode is not an exception. It is the machine resetting with the page cache
359
+ converted out from under it, no OOM message and no shutdown sequence. Budget the full
360
+ post-conversion footprint, and count what other components will claim from the same RAM
361
+ afterwards (a leaf-offloaded VAE lands there too).
362
+ - **Ordering, when a load both transforms and quantises:** structural transform first,
363
+ quantisation last, and a prequantized source takes no structural transform at all. The three
364
+ clauses and why they are not negotiable are in `models/offload.py`'s docstring.
365
+ - **Vendoring unreleased upstream code** → `models/<name>/vendor/`, **verbatim, import rewrites
366
+ only**. Put a provenance header in its `__init__.py` naming the repo, PR, branch, commit sha and
367
+ date. `models/*/vendor/` is already excluded from ruff and pyright by a glob, because editing it to
368
+ satisfy our linters destroys the one property that makes a re-sync reviewable. Never patch
369
+ installed diffusers: construct components directly and pass them in, so nothing resolves a class by
370
+ name through a registry we do not own. Pin, don't floor, any dependency whose experimental surface
371
+ the vendored code imports from.
372
+ - **New model runner** → a subpackage `models/<name>/` with `runner.py` (a `NodeDescriptor` + a
373
+ `NodeRunner` + `register_<name>(registry, store, policy)`) and an `__init__.py` re-exporting it;
374
+ add a `try/except ImportError` block in `server/bootstrap.py`; add an optional-deps extra in
375
+ `pyproject.toml`. Copy `models/zimage/` - it's the reference.
376
+ - **New low-level primitive** → descriptor in `graph/primitives.py`; its runner lands with the C2 work
377
+ (build a component in `components/`, wire it through `encode`/`sample`/`vae` and the sampler seam).
378
+ - **New `/v1` route** → add it in `server/app.py`, shape the JSON in `server/serialize.py`, keep errors
379
+ as `{error:{code,message}}` with the right status. Declare its shape in `server/schemas.py` and tag
380
+ it in `server/docs.py`, or `/api` documents it as returning "any JSON". Update the API list in
381
+ `README.md`.
382
+ - **New port/handle type** → `PortKind` in `graph/schema.py` (+ `port_satisfies` if it has coercions).
383
+ - **New device/memory behaviour** → behind `DevicePolicy` in `device/`; never in a component.