Skip to content

Commit

Permalink
fix: support SDXL loras
Browse files Browse the repository at this point in the history
  • Loading branch information
db0 committed Nov 12, 2023
1 parent 2412860 commit b09cf1b
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion LucidCreations.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ margin_top = 218.0
margin_right = 300.0
margin_bottom = 246.0
text = "k_lms"
items = [ "k_lms", null, false, 0, null, "k_heun", null, false, 1, null, "k_euler", null, false, 2, null, "k_euler_a", null, false, 3, null, "k_dpm_2", null, false, 4, null, "k_dpm_2_a", null, false, 5, null, "k_dpm_fast", null, false, 6, null, "k_dpm_adaptive", null, false, 7, null, "k_dpmpp_2s_a", null, false, 8, null, "k_dpmpp_2m", null, false, 9, null, "dpmsolver", null, false, 10, null ]
items = [ "k_lms", null, false, 0, null, "k_heun", null, false, 1, null, "k_euler", null, false, 2, null, "k_euler_a", null, false, 3, null, "k_dpm_2", null, false, 4, null, "k_dpm_2_a", null, false, 5, null, "k_dpm_fast", null, false, 6, null, "k_dpm_adaptive", null, false, 7, null, "k_dpmpp_2s_a", null, false, 8, null, "k_dpmpp_2m", null, false, 9, null, "dpmsolver", null, false, 10, null, "k_dpmpp_sde", null, false, 11, null ]
selected = 0

[node name="SeedLabel" type="Label" parent="Margin/Panel/Display/Panels/Controls/Advanced"]
Expand Down
1 change: 0 additions & 1 deletion addons/stable_horde_client/AIImageTexture.gd
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,4 @@ static func sanitize_filename(filename: String) -> String:
]
for c in replace_chars:
filename = filename.replace(c,'_')
print_debug(filename)
return(filename)
4 changes: 2 additions & 2 deletions addons/stable_horde_client/civitai_lora_model_fetch.gd
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ func _parse_civitai_lora_data(civitai_entry) -> Dictionary:
lora_details["unusable"] = 'Attention! This LoRa is unusable because it does not provide file validation.'
elif not lora_details["url"]:
lora_details["unusable"] = 'Attention! This LoRa is unusable because it appears to have no valid safetensors upload.'
elif not is_default and lora_details["size_mb"] > 150:
lora_details["unusable"] = 'Attention! This LoRa is unusable because is exceeds the max 150Mb filesize we allow on the AI Horde.'
elif not is_default and lora_details["size_mb"] > 230:
lora_details["unusable"] = 'Attention! This LoRa is unusable because is exceeds the max 230Mb filesize we allow on the AI Horde.'
lora_details["images"] = []
for img in versions[0]["images"]:
if img["nsfw"] in ["Mature", "X"]:
Expand Down
4 changes: 2 additions & 2 deletions addons/stable_horde_client/civitai_lora_reference.gd
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ func _parse_civitai_lora_data(civitai_entry) -> Dictionary:
lora_details["unusable"] = 'Attention! This LoRa is unusable because it does not provide file validation.'
elif not lora_details["url"]:
lora_details["unusable"] = 'Attention! This LoRa is unusable because it appears to have no valid safetensors upload.'
elif lora_details["size_mb"] > 150:
lora_details["unusable"] = 'Attention! This LoRa is unusable because is exceeds the max 150Mb filesize we allow on the AI Horde.'
elif lora_details["size_mb"] > 230:
lora_details["unusable"] = 'Attention! This LoRa is unusable because is exceeds the max 230Mb filesize we allow on the AI Horde.'
lora_details["images"] = []
for img in versions[0]["images"]:
if img["nsfw"] in ["Mature", "X"]:
Expand Down
4 changes: 2 additions & 2 deletions addons/stable_horde_client/civitai_ti_model_fetch.gd
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ func _parse_civitai_ti_data(civitai_entry) -> Dictionary:
ti_details["unusable"] = 'Attention! This Textual Inversion is unusable because it does not provide file validation.'
elif not ti_details["url"]:
ti_details["unusable"] = 'Attention! This Textual Inversion is unusable because it appears to have no valid safetensors upload.'
elif not is_default and ti_details["size_mb"] > 150:
ti_details["unusable"] = 'Attention! This Textual Inversion is unusable because is exceeds the max 150Mb filesize we allow on the AI Horde.'
elif not is_default and ti_details["size_mb"] > 230:
ti_details["unusable"] = 'Attention! This Textual Inversion is unusable because is exceeds the max 230Mb filesize we allow on the AI Horde.'
ti_details["images"] = []
for img in versions[0]["images"]:
if img["nsfw"] in ["Mature", "X"]:
Expand Down
4 changes: 2 additions & 2 deletions addons/stable_horde_client/civitai_ti_reference.gd
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ func _parse_civitai_ti_data(civitai_entry) -> Dictionary:
ti_details["unusable"] = 'Attention! This Textual Inversion is unusable because it does not provide file validation.'
elif not ti_details["url"]:
ti_details["unusable"] = 'Attention! This Textual Inversion is unusable because it appears to have no valid safetensors upload.'
elif ti_details["size_mb"] > 150:
ti_details["unusable"] = 'Attention! This Textual Inversion is unusable because is exceeds the max 150Mb filesize we allow on the AI Horde.'
elif ti_details["size_mb"] > 230:
ti_details["unusable"] = 'Attention! This Textual Inversion is unusable because is exceeds the max 230Mb filesize we allow on the AI Horde.'
ti_details["images"] = []
for img in versions[0]["images"]:
if img["nsfw"] in ["Mature", "X"]:
Expand Down
8 changes: 6 additions & 2 deletions addons/stable_horde_client/stable_horde_client.gd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ enum SamplerMethods {
k_dpm_adaptive
k_dpmpp_2s_a
k_dpmpp_2m
k_dpmpp_sde
dpmsolver
}

Expand Down Expand Up @@ -55,7 +56,7 @@ export(int,64,1024,64) var height := 512
# Generally there's usually no reason to go above 50 unless you know what you're doing.
export(int,1,100) var steps := 30
# Advanced: The sampler used to generate. Provides slight variations on the same prompt.
export(String, "k_lms", "k_heun", "k_euler", "k_euler_a", "k_dpm_2", "k_dpm_2_a", "k_dpm_fast", "k_dpm_adaptive", "k_dpmpp_2s_a", "k_dpmpp_2m", "dpmsolver") var sampler_name := "k_euler_a"
export(String, "k_lms", "k_heun", "k_euler", "k_euler_a", "k_dpm_2", "k_dpm_2_a", "k_dpm_fast", "k_dpm_adaptive", "k_dpmpp_2s_a", "k_dpmpp_2m", "k_dpmpp_sde", "dpmsolver") var sampler_name := "k_euler_a"
# How closely to follow the prompt given
export(float,0,30,0.5) var cfg_scale := 7.5
# The number of CLIP language processor layers to skip.
Expand Down Expand Up @@ -150,7 +151,10 @@ func generate(replacement_prompt := '', replacement_params := {}) -> void:
"r2": r2,
"shared": shared,
"dry_run": dry_run,
# "workers": ["dc0704ab-5b42-4c65-8471-561be16ad696"], # debug
"workers": [
"ba9937fb-8558-4d42-9059-926de5f0fe4e", #pama
"dc0704ab-5b42-4c65-8471-561be16ad696", #portal
], # debug
}
# print_debug(submit_dict)
if source_image:
Expand Down
1 change: 1 addition & 0 deletions src/Lora/Lora.gd
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ func check_baseline_compatibility(lora_name) -> int:
if baselines.size() == 0:
return LoraCompatible.MAYBE
var lora_to_model_baseline_map = {
"SDXL 1.0": "stable_diffusion_xl",
"SD 1.5": "stable diffusion 1",
"SD 2.1 768": "stable diffusion 2",
"SD 2.1 512": "stable diffusion 2",
Expand Down

0 comments on commit b09cf1b

Please sign in to comment.