code wiki / _hdl_build / nx_companion_wardrobe.nx
nx_companion_wardrobe.nx
buildroot/runtime/_hdl_build/nx_companion_wardrobe.nx
about
nx_companion_wardrobe.nx -- the CompanionWardrobe object: the occlusion-aware photo-prompt compiler (the Z-Image
"painter not compositor" fix). Resolves a scene into per-zone clothing-OR-bare with a POSITIVE occlusion assertion
(fabric obscures when clothed; bare only when the scene asks) so clothed shots stay clothed + nude only on request
= the controllable wardrobe layer. Composes the anatomy-neutral identity from CompanionIdentity. Extracted from
nx_gen_orchestrator (monolith -> objects); behaviour-preserving (body byte-identical except private cw_* helpers).
⚠this is where ER-8 negatives + ControlNet pose/structure control will compose. Object model: companion_arch.md.
license_tier: ORIGINAL
dependencies 3 imports · 3 importers
imports: nx_syscalls.nxnx_companion_identity.nxnx_gen_conf_lib.nx
imported by: nx_elara_prompt_probe.nxnx_gen_orchestrator.nxnx_gen_promptweight_gate.nx
structs
| none |
consts
| 49 | const CW_W_IDENT: i64 = 1000 |
| 50 | const CW_W_MIN_DEFAULT: i64 = 100 |
| 51 | const CW_W_MAX_DEFAULT: i64 = 2000 |
| 52 | const CW_W_SLOTS: i64 = 5 |
| 53 | const CW_W_BYTES: i64 = 40 |
| 54 | const CW_W_MIN: i64 = 0 |
| 55 | const CW_W_MAX: i64 = 1 |
| 56 | const CW_W_TRIGGER: i64 = 2 |
| 57 | const CW_W_CAMERA: i64 = 3 |
| 58 | const CW_W_IDENTITY: i64 = 4 |
| 59 | const CW_W_REFUSED: i64 = 0 - 1 |
| 60 | const CW_W_PERMIL: i64 = 1000 |
| 61 | const CW_CH_LPAREN: i64 = 40 |
| 62 | const CW_CH_RPAREN: i64 = 41 |
| 63 | const CW_CH_COLON: i64 = 58 |
| 64 | const CW_CH_DOT: i64 = 46 |
| 65 | const CW_CH_D0: i64 = 48 |
| 66 | const CW_CH_D9: i64 = 57 |
| 67 | const CW_CH_BACKSLASH: i64 = 92 |
| 68 | const CW_B10: i64 = 10 |
| 69 | const CW_B100: i64 = 100 |
| 70 | const CW_W_CONF_REL: *u8 = "knowledge/gen_prompt_weight.conf" |
| 71 | const CW_W_CONF_ABS: *u8 = "/volume1/homes/elderwesto/nishihost/knowledge/gen_prompt_weight.conf" |
functions
| 12 | func cw_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){dst[o]=s[i]; o=o+1; i=i+1} return o } |
| 13 | func cw_catb(dst: *u8, off: i64, src: *u8, n: i64) -> i64 { var o: i64=off; var i: i64=0; while i<n {dst[o]=src[i]; o=o+1; i=i+1} return o } called by 1: go_build_photo_prompt |
| 14 | func cw_contains_ci(hay: *u8, hlen: i64, needle: *u8) -> i64 |
| 72 | func cw_putnum(dst: *u8, off: i64, v: i64) -> i64 |
| 85 | func cw_weights_parse(b: *u8, n: i64, out: *i64) -> i64 |
| 97 | func cw_weights_load(out: *i64) -> i64 |
| 104 | func cw_weight_admitted(w: i64, env: *i64) -> i64 { if w < env[CW_W_MIN] { return 0 } if w > env[CW_W_MAX] { return 0 } return 1 } |
| 108 | func cw_prompt_weight(dst: *u8, off: i64, text: *u8, w: i64, env: *i64) -> i64 |
| 126 | func cw_weight_slot(dst: *u8, off: i64, text: *u8, wts: *i64, slot: i64) -> i64 |
| 134 | func cw_weight_permil_at(s: *u8, n: i64, i0: i64, endp: *i64) -> i64 called by 1: cw_weight_admit |
| 155 | func cw_weight_admit(s: *u8, n: i64, env: *i64, badat: *i64, badw: *i64) -> i64 |
| 179 | func go_build_photo_prompt(scene: *u8, slen: i64, expr: *u8, out: *u8) -> i64 called by 1: go_compose_photo_prompt calls 8: sys_mmapgo_load_appearancecw_weights_loadcw_weight_slotcw_contains_cicw_cat+2 |
| 258 | func go_compose_photo_prompt(scene: *u8, slen: i64, expr: *u8, seed: i64, out: *u8) -> i64 |