aszc-dev / ComfyUI-CoreMLSuite

A set of custom nodes for ComfyUI that allow you to use Core ML models in your ComfyUI workflows.
GNU General Public License v3.0
92 stars 8 forks source link

Unable to generate proper images by the combined of LoRA and SD model on Mac #47

Open Aeolian012 opened 1 week ago

Aeolian012 commented 1 week ago

Dear Developer,

I am using the 'Load LoRA to use with Core ML' node and the 'Convert Checkpoint to CoreML' node in my workflow. I successfully generated the combined .mlmodelc file (SD model: Cetus-Mix sd_v1-5.safetensor, LoRA model: Anime Lineart / Manga-like.safetensor, Combined model name: cetusMix_Whalefall2_lineArt_V4-16_1x512x768_se_unet.mlmodelc), but the generated images are blurry color blocks in the subsequent steps. I have also noticed that others might have had similar issues. Could you guide me on resolving this?

Thank you for your dedication; this project significantly contributes to Mac users.

Sincerely,

workflow screen shot

截屏2024-07-05 23 20 59

generated combined core ML model (sd model with lora model)

截屏2024-07-05 23 41 52
Aeolian012 commented 1 week ago
截屏2024-07-05 23 49 26

this is the section page in RADEME file I was trying to reproduce

aszc-dev commented 6 days ago

Hello @Aeolian012,

Currently, there isn’t a consistent working solution for LoRAs—some work while others don’t, and I can’t pinpoint the exact reason. The only way to verify functionality is by checking each LoRA individually. We may need to update the README file to clarify this.

Is issue #36 similar to what you’re experiencing?

Cheers, Adrian

Aeolian012 commented 6 days ago

@aszc-dev I understand that, Thank you for reply! I think issue 36 has the same type of problem as mine.

Aeolian012 commented 5 days ago

Hello @aszc-dev, Besides that, I also want to ask, what causes such an error to occur like this? It seems that changing the number of prompts can cause this error occurred when executing KSampler or core ml Sampler

Sizes of tensors must match except in dimension 0. Expected size 154 but got size 77 for tensor number 1 in the list.

Error occurred when executing CoreMLSampler:

Expected shape (1, 4, 64, 96), got (1, 4, 64, 64) for input: sample

Thank you for your time and attention.

截屏2024-07-11 03 02 46
aszc-dev commented 1 day ago

Hello @Aeolian012,

I’m not entirely sure, but I think the first error might be caused by the prompt being too long. Please try shortening the prompt and see if that helps.

The second error (Expected shape (1, 4, 64, 96), got (1, 4, 64, 64) for input: sample) is due to a mismatch between the expected model input dimensions and the empty latent image. In your screenshot, I can see that you have a 768x512 Empty Latent Image node, but it appears that a 512x512 node is connected to the sampler. Please try using the 768x512 node and see if that resolves the issue.

Cheers, Adrian