Merge pull request #1107 from ogmaresca/save-lora-strength-in-metadata

Add LoRA Strength to metadata files
This commit is contained in:
cmdr2 2023-04-06 15:47:23 +05:30 committed by GitHub
commit 888dc05cde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -28,7 +28,7 @@ TASK_TEXT_MAPPING = {
"use_hypernetwork_model": "Hypernetwork model", "use_hypernetwork_model": "Hypernetwork model",
"hypernetwork_strength": "Hypernetwork Strength", "hypernetwork_strength": "Hypernetwork Strength",
"use_lora_model": "LoRA model", "use_lora_model": "LoRA model",
# "lora_alpha": "LoRA Strength", "lora_alpha": "LoRA Strength",
} }

View File

@ -221,7 +221,7 @@
<input id="lora_model" type="text" spellcheck="false" autocomplete="off" class="model-filter" data-path="" /> <input id="lora_model" type="text" spellcheck="false" autocomplete="off" class="model-filter" data-path="" />
</td></tr> </td></tr>
<tr id="lora_alpha_container" class="pl-5"> <tr id="lora_alpha_container" class="pl-5">
<td><label for="lora_alpha_slider">LoRA strength:</label></td> <td><label for="lora_alpha_slider">LoRA Strength:</label></td>
<td> <input id="lora_alpha_slider" name="lora_alpha_slider" class="editor-slider" value="50" type="range" min="0" max="100"> <input id="lora_alpha" name="lora_alpha" size="4" pattern="^[0-9\.]+$" onkeypress="preventNonNumericalInput(event)"><br/></td> <td> <input id="lora_alpha_slider" name="lora_alpha_slider" class="editor-slider" value="50" type="range" min="0" max="100"> <input id="lora_alpha" name="lora_alpha" size="4" pattern="^[0-9\.]+$" onkeypress="preventNonNumericalInput(event)"><br/></td>
</tr> </tr>
<tr class="pl-5"><td><label for="hypernetwork_model">Hypernetwork:</i></label></td><td> <tr class="pl-5"><td><label for="hypernetwork_model">Hypernetwork:</i></label></td><td>

View File

@ -245,6 +245,14 @@ const TASK_MAPPING = {
readUI: () => loraModelField.value, readUI: () => loraModelField.value,
parse: (val) => val parse: (val) => val
}, },
lora_alpha: { name: 'LoRA Strength',
setUI: (lora_alpha) => {
loraAlphaField.value = lora_alpha
updateLoraAlphaSlider()
},
readUI: () => parseFloat(loraAlphaField.value),
parse: (val) => parseFloat(val)
},
use_hypernetwork_model: { name: 'Hypernetwork model', use_hypernetwork_model: { name: 'Hypernetwork model',
setUI: (use_hypernetwork_model) => { setUI: (use_hypernetwork_model) => {
const oldVal = hypernetworkModelField.value const oldVal = hypernetworkModelField.value