Convert this image into minimalist art style
Description
Convert this image into minimalist art style
FAQ
Comments (5)
this lora is not in comfyui format, use the code below to convert to comyui lora format.
import torch, os
from safetensors import safe_open
from safetensors.torch import save_file
def convert_lora_weights(lora_sd: dict[str, torch.Tensor], prefix: str) -> dict[str, torch.Tensor]:
converted_weights, lora_dims = {}, {}
for key, weight in lora_sd.items():
if not (key.startswith("diffusion_model.") or key.startswith("transformer.")): continue
base_name = key.split(".", 1)[1]
new_key = f"{prefix}{base_name}".replace(".", "_").replace("_lora_A_", ".lora_down.").replace("_lora_B_", ".lora_up.")
converted_weights[new_key] = weight
if "lora_down" in new_key:
lora_name = ".".join(new_key.split(".")[:-1])
lora_dims[lora_name] = weight.shape[0]
for lora_name, dim in lora_dims.items():
converted_weights[f"{lora_name}.alpha"] = torch.tensor(float(dim))
return converted_weights
def process_safetensor_file(input_path: str, output_path: str, prefix: str = "lora_"):
if not os.path.exists(input_path): return
loaded_tensors = {}
with safe_open(input_path, framework="pt", device="cpu") as f:
for key in f.keys(): loaded_tensors[key] = f.get_tensor(key)
converted_tensors = convert_lora_weights(loaded_tensors, prefix)
save_file(converted_tensors, output_path)
if name == "__main__":
input_path = 'path/to/original_lora'
output_path = "converted_output1.safetensors"
process_safetensor_file(input_path, output_path, prefix="lora_unet_")
if os.path.exists(output_path):
with safe_open(output_path, framework="pt", device="cpu") as f:
for key in f.keys(): print(f" - {key}: {f.get_tensor(key).shape}")
it doesn't work :(
works for me in Comfy
Hi! ChatGPT says: ".safetensors file is not a LoRA for Stable Diffusion or ComfyUI. It's a LoRA for a different architecture โ most likely a CLIP-like multimodal model that isn't directly compatible with SD or ComfyUI."
Quality is very dependent on the seed for me.


