MCPcopy Index your code
hub / github.com/easydiffusion/easydiffusion / loadModifiers

Function loadModifiers

ui/media/js/image-modifiers.js:157–183  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

155}
156
157async function loadModifiers() {
158 try {
159 let res = await fetch("/get/modifiers")
160 if (res.status === 200) {
161 res = await res.json()
162
163 modifiers = res // update global variable
164
165 res.reverse()
166
167 res.forEach((modifierGroup, idx) => {
168 const isInitiallyOpen = false // idx === res.length - 1
169 const removeBy = modifierGroup === "Artist" ? true : false // only remove "By " for artists
170
171 createModifierGroup(modifierGroup, isInitiallyOpen, removeBy)
172 })
173
174 createCollapsibles(editorModifierEntries)
175 }
176 } catch (e) {
177 console.error("error fetching modifiers", e)
178 }
179
180 loadCustomModifiers()
181 resizeModifierCards(modifierCardSizeSlider.value)
182 document.dispatchEvent(new Event("loadImageModifiers"))
183}
184
185function refreshModifiersState(newTags, inactiveTags) {
186 // clear existing modifiers

Callers

nothing calls this directly

Calls 6

createModifierGroupFunction · 0.85
createCollapsiblesFunction · 0.85
loadCustomModifiersFunction · 0.85
resizeModifierCardsFunction · 0.85
jsonMethod · 0.45
dispatchEventMethod · 0.45

Tested by

no test coverage detected