+ ${lo(e.loraName,r)} ${po()}
+ ${o.weights[m.TENC]&&k`
`}
+ ${[m.UNET,m.START,m.STOP].filter(a=>!!o.weights[a]).map(a=>k`
`)}
+
+
+
+
+
+ ${go()} ${co()}
+
+
+ ${e.previewState.modelName?ho(e.previewState):""}
+
+ `}function _o(){let e=()=>{let s=L();s.uiState.isVisible&&(Se(),le(s))},t=s=>{let l=L();if(l.uiState.isVisible){s.preventDefault(),Se(),le(l);return}let i=It(s);i&&(s.preventDefault(),Bo(i))},o=s=>{let l=L();if(l.uiState.isVisible){let i=document.getElementById("weight-helper");if(!i)return;let g=se();if(s){let u=s.target;if(i.contains(u)||u.id===`${g}_token_button`||u.id===`${g}_lora_edit_user_metadata_button`||u.className==="global-popup-close")return;if(u.id.indexOf("_interrupt")>0){Se();return}}Se(),le(l)}},r=s=>{if(s.key==="Escape"){let l=L();Ao(l)}};gradioApp().querySelectorAll("button:is([id*='_generate'])").forEach(s=>{s.addEventListener("click",e,!0)}),gradioApp().querySelectorAll("*:is([id*='_toprow'] [id*='_prompt'], .prompt) textarea").forEach(s=>{s.addEventListener("contextmenu",t)}),document.addEventListener("click",o),document.addEventListener("keyup",r)}var mo=!1;function So(e){et(fo(),e),mo||(Wt(()=>{et(fo(),e)}),Nt(t=>{let o=e.querySelector("#weight-helper");o&&(o.style.top=t.top+"px",o.style.left=t.left+"px")}),mo=!0)}function Bo(e){let{tabId:t,textarea:o,selectionStart:r,selectionEnd:n,namespace:a,loraName:s,loraParams:l,top:i,left:g}=e;Lt(t),Ct(o),$t(r),Me(n),Bt(o.value.substring(r,n)),At(t),Et(t),T(m.START).max=ke(),T(m.STOP).max=ke(),T(m.STOP).default=ke();let u=document.getElementById("weight-helper").getBoundingClientRect(),c=window.innerHeight-u.bottom,h=i;c<0&&(u.top<0?h=window.scrollY:h+=c);let p=Zt(a,s,l);Dt(p);let w=document.getElementById("weight-helper");if(w&&(w.style.top=h+"px",w.style.left=g+"px"),!p.metadataState){let b=Pe();Ie(s,!1,b.signal).then(f=>{let M=p.weightState.selectedModelType;(!M||M===y.Unknown)&&(M=f.modelType??y.Unknown);let C=p.weightState.selectedLoraBlockType,W=N(M,C),q=F(p.weightState.weights,W),Ue={...p.weightState,selectedModelType:M,selectedLoraBlockType:C},bo=_(p.loraName,Ue).loraParams;p.weightState.xyzMode||(ee(s,{loraParams:bo,selectedLoraBlockType:C,selectedModelType:M}),zt(O(s).length-1)),Ce({algorithm:f.algorithm||"Unknown",modelType:f.modelType||"Unknown",baseModel:f.baseModel||"Unknown",selectedModelType:M,usingBlocks:f.usingBlocks,blockGroups:W,lbwPresets:$(M,p.weightState.selectedLoraBlockType),weights:q})}).catch(f=>{f.name!=="AbortError"&&(console.error("Error fetching metadata:",f),ce(!1))})}if(!p.previewState.modelId){let b=qt();Kt(s,b.signal).then(async f=>{f.thumbUrl!==be&&(f.thumbUrl=f.thumbUrl),bt(s,f),Yt(f)}).catch(f=>{f.name!=="AbortError"&&console.error("Error fetching metadata:",f)})}}function Se(){let e=_e();Ot(e)}function Ao(e){opts.weight_helper_using_execCommand||le(e,!0),Se()}var Ne,Eo=new Promise(e=>{Ne=e});pt();onUiLoaded(()=>{if(!gradioApp().querySelector("#lbw_ratiospreset"))return;let o=[...getComputedStyle(document.documentElement).getPropertyValue("--body-text-color").trim().slice(1).match(/.{1,2}/g).map(r=>parseInt(r,16)),.3];document.documentElement.style.setProperty("--weight-helper-shadow",`rgba(${o.join(",")})`),document.documentElement.style.setProperty("--weight-helper-slider_size",String(opts.weight_helper_slider_length)),Eo.then(()=>{let r=document.createElement("div");r.id="weight-helper-container",gradioApp().appendChild(r),at(),Ut(_e()),So(r)})});onOptionsChanged(()=>{Ne&&(Ne(!0),Ne=null)});})();
+/*! Bundled license information:
+
+lit-html/lit-html.js:
+ (**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ *)
+*/
+//# sourceMappingURL=weight_helper.js.map
diff --git a/sd-webui-weight-helper-main/javascript/weight_helper.js.map b/sd-webui-weight-helper-main/javascript/weight_helper.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..3c3a4100be5f1f53565b80ec77cc1676d09dcb55
--- /dev/null
+++ b/sd-webui-weight-helper-main/javascript/weight_helper.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": ["../src/shared/types/lora-types.ts", "../src/shared/constants/common-const.ts", "../src/shared/manager/config-manager.ts", "../src/shared/manager/history-manager.ts", "../src/shared/utils/common-utils.ts", "../src/shared/manager/cache-manager.ts", "../src/shared/state/current-state.ts", "../src/shared/utils/helper-utils.ts", "../src/shared/utils/editor-utils.ts", "../src/shared/state/global-weight-helper-state.ts", "../src/shared/utils/state-utils.ts", "../src/shared/manager/api-manager.ts", "../src/shared/utils/api-utils.ts", "../src/shared/utils/weight-utils.ts", "../node_modules/lit-html/src/lit-html.ts", "../src/components/sections/common-section.ts", "../src/components/sections/header-section.ts", "../src/components/sections/lbw-section.ts", "../src/components/sections/lora-settings-section.ts", "../src/components/sections/metadata-section.ts", "../src/components/sections/preview-section.ts", "../src/components/ui-template.ts", "../src/index.ts"],
+ "sourcesContent": ["export const NamespaceTypes = {\n lora: 'lora',\n lyco: 'lyco',\n} as const;\nexport type NamespaceTypes = (typeof NamespaceTypes)[keyof typeof NamespaceTypes];\n\nexport const LoraBlockTypes = {\n lora: 'lora',\n lycoris: 'lycoris',\n Unknown: 'Unknown',\n} as const;\nexport type LoraBlockTypes = (typeof LoraBlockTypes)[keyof typeof LoraBlockTypes];\n\nexport const ModelTypes = {\n SD: 'SD',\n SDXL: 'SDXL',\n Flux: 'Flux',\n Unknown: 'Unknown',\n} as const;\nexport type ModelTypes = (typeof ModelTypes)[keyof typeof ModelTypes];\n\nexport const LoraDefineParams = {\n te: 'te',\n unet: 'unet',\n start: 'start',\n stop: 'stop',\n step: 'step',\n lbw: 'lbw',\n lbwe: 'lbwe',\n} as const;\nexport type LoraDefineParams = (typeof LoraDefineParams)[keyof typeof LoraDefineParams];\n\nexport const WeightControllerTypes = {\n TENC: 'TEnc',\n UNET: 'UNet',\n START: 'Start',\n STOP: 'Stop',\n LBW: 'LBW',\n} as const;\nexport type WeightControllerTypes = (typeof WeightControllerTypes)[keyof typeof WeightControllerTypes];\n", "import { LoraBlockTypes, ModelTypes } from '@/shared/types/lora-types';\n\nconst BASE_MODEL_TYPE = {\n STABLE_DIFFUSION: [\n 'BASE',\n 'IN00',\n 'IN01',\n 'IN02',\n 'IN03',\n 'IN04',\n 'IN05',\n 'IN06',\n 'IN07',\n 'IN08',\n 'IN09',\n 'IN10',\n 'IN11',\n 'M00',\n 'OUT00',\n 'OUT01',\n 'OUT02',\n 'OUT03',\n 'OUT04',\n 'OUT05',\n 'OUT06',\n 'OUT07',\n 'OUT08',\n 'OUT09',\n 'OUT10',\n 'OUT11',\n ],\n BLACK_FOREST_LABS: [\n 'CLIP',\n 'T5',\n 'IN',\n 'D00',\n 'D01',\n 'D02',\n 'D03',\n 'D04',\n 'D05',\n 'D06',\n 'D07',\n 'D08',\n 'D09',\n 'D10',\n 'D11',\n 'D12',\n 'D13',\n 'D14',\n 'D15',\n 'D16',\n 'D17',\n 'D18',\n 'S00',\n 'S01',\n 'S02',\n 'S03',\n 'S04',\n 'S05',\n 'S06',\n 'S07',\n 'S08',\n 'S09',\n 'S10',\n 'S11',\n 'S12',\n 'S13',\n 'S14',\n 'S15',\n 'S16',\n 'S17',\n 'S18',\n 'S19',\n 'S20',\n 'S21',\n 'S22',\n 'S23',\n 'S24',\n 'S25',\n 'S26',\n 'S27',\n 'S28',\n 'S29',\n 'S30',\n 'S31',\n 'S32',\n 'S33',\n 'S34',\n 'S35',\n 'S36',\n 'S37',\n 'OUT',\n ],\n};\n\nexport const LBW_BLOCKS = {\n [ModelTypes.SD]: BASE_MODEL_TYPE.STABLE_DIFFUSION,\n [ModelTypes.SDXL]: BASE_MODEL_TYPE.STABLE_DIFFUSION,\n [ModelTypes.Flux]: BASE_MODEL_TYPE.BLACK_FOREST_LABS,\n [ModelTypes.Unknown]: [],\n};\n\nexport const lbwMaskDefine = {\n [ModelTypes.SD]: {\n [LoraBlockTypes.lora]: [1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n [LoraBlockTypes.lycoris]: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n [LoraBlockTypes.Unknown]: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n },\n [ModelTypes.SDXL]: {\n [LoraBlockTypes.lora]: [1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0],\n [LoraBlockTypes.lycoris]: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0],\n [LoraBlockTypes.Unknown]: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n },\n [ModelTypes.Flux]: {\n [LoraBlockTypes.lora]: [\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n ],\n [LoraBlockTypes.lycoris]: [\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n ],\n [LoraBlockTypes.Unknown]: [\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n ],\n },\n [ModelTypes.Unknown]: {\n [LoraBlockTypes.lora]: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [LoraBlockTypes.lycoris]: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [LoraBlockTypes.Unknown]: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n },\n};\n\nexport const XYZ_PRESETS = {\n [ModelTypes.SD]: {\n [LoraBlockTypes.lora]: 'XYZ(17)',\n [LoraBlockTypes.lycoris]: 'XYZ(26)',\n [LoraBlockTypes.Unknown]: 'XYZ(26)',\n },\n [ModelTypes.SDXL]: {\n [LoraBlockTypes.lora]: 'XYZ(12)',\n [LoraBlockTypes.lycoris]: 'XYZ(20)',\n [LoraBlockTypes.Unknown]: 'XYZ(26)',\n },\n [ModelTypes.Flux]: {\n [LoraBlockTypes.lora]: 'XYZ(19)',\n [LoraBlockTypes.lycoris]: 'XYZ(19)',\n [LoraBlockTypes.Unknown]: 'XYZ(19)',\n },\n [ModelTypes.Unknown]: {\n [LoraBlockTypes.lora]: 'XYZ(17)',\n [LoraBlockTypes.lycoris]: 'XYZ(26)',\n [LoraBlockTypes.Unknown]: 'XYZ(26)',\n },\n};\n\nexport const SELECTABLE_MODEL_TYPES = {\n '': ModelTypes.Unknown,\n SD: ModelTypes.SD,\n SDXL: ModelTypes.SDXL,\n Flux: ModelTypes.Flux,\n};\n\nexport const SELECTABLE_LORA_BLOCK_TYPES = {\n '': LoraBlockTypes.Unknown,\n 'LoRA(LierLa)': LoraBlockTypes.lora,\n 'LyCORIS,etc': LoraBlockTypes.lycoris,\n};\n\nexport const CARD_NO_IMAGE_PATH = './file=html/card-no-preview.png';\n", "import {\n LBW_BLOCKS,\n lbwMaskDefine as LBW_MASK_DEFINE,\n SELECTABLE_LORA_BLOCK_TYPES,\n SELECTABLE_MODEL_TYPES,\n XYZ_PRESETS,\n} from '@/shared/constants/common-const';\nimport { LoraBlockTypes, ModelTypes, WeightControllerTypes } from '@/shared/types/lora-types';\n\ninterface WeightControllerInterface {\n min: number;\n max: number;\n default: number;\n step: number;\n}\n\nconst WeightControllerConfig: Record