code wiki / _hdl_build / nx_companion_wardrobe.nx

nx_companion_wardrobe.nx

buildroot/runtime/_hdl_build/nx_companion_wardrobe.nx

16349 B272 linesdepth 3pulls 4 transitivereach 9 importersview sourcekind librarytopic companion
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_companion_identity.nx nx_gen_conf_lib.nx nx_companion_wardrobe.nx nx_elara_prompt_probe.nx nx_gen_orchestrator.nx nx_gen_promptweight_gate.nx

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

49const CW_W_IDENT: i64 = 1000
50const CW_W_MIN_DEFAULT: i64 = 100
51const CW_W_MAX_DEFAULT: i64 = 2000
52const CW_W_SLOTS: i64 = 5
53const CW_W_BYTES: i64 = 40
54const CW_W_MIN: i64 = 0
55const CW_W_MAX: i64 = 1
56const CW_W_TRIGGER: i64 = 2
57const CW_W_CAMERA: i64 = 3
58const CW_W_IDENTITY: i64 = 4
59const CW_W_REFUSED: i64 = 0 - 1
60const CW_W_PERMIL: i64 = 1000
61const CW_CH_LPAREN: i64 = 40
62const CW_CH_RPAREN: i64 = 41
63const CW_CH_COLON: i64 = 58
64const CW_CH_DOT: i64 = 46
65const CW_CH_D0: i64 = 48
66const CW_CH_D9: i64 = 57
67const CW_CH_BACKSLASH: i64 = 92
68const CW_B10: i64 = 10
69const CW_B100: i64 = 100
70const CW_W_CONF_REL: *u8 = "knowledge/gen_prompt_weight.conf"
71const CW_W_CONF_ABS: *u8 = "/volume1/homes/elderwesto/nishihost/knowledge/gen_prompt_weight.conf"

functions

12func 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 }
13func 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 }
14func cw_contains_ci(hay: *u8, hlen: i64, needle: *u8) -> i64
72func cw_putnum(dst: *u8, off: i64, v: i64) -> i64
called by 1: cw_prompt_weight calls 1: sys_mmap
85func cw_weights_parse(b: *u8, n: i64, out: *i64) -> i64
called by 2: cw_weights_loadmain calls 1: gc_ints
97func cw_weights_load(out: *i64) -> i64
104func 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 }
108func cw_prompt_weight(dst: *u8, off: i64, text: *u8, w: i64, env: *i64) -> i64
126func cw_weight_slot(dst: *u8, off: i64, text: *u8, wts: *i64, slot: i64) -> i64
134func cw_weight_permil_at(s: *u8, n: i64, i0: i64, endp: *i64) -> i64
called by 1: cw_weight_admit
155func cw_weight_admit(s: *u8, n: i64, env: *i64, badat: *i64, badw: *i64) -> i64
179func go_build_photo_prompt(scene: *u8, slen: i64, expr: *u8, out: *u8) -> i64
258func go_compose_photo_prompt(scene: *u8, slen: i64, expr: *u8, seed: i64, out: *u8) -> i64