Open cylemguang42 opened 12 months ago
Hello. First of all, it's great to hear you're conducting your own experiments. The topic of Core ML is very broad, too broad for one person, especially considering how much is happening in Stable Diffusion world lately.
I remember going through Kosinkadink's code to see if there was a simple and easy way of adding AnimateDiff to existing Core ML workflow. I recall coming up to a conclusion that there's no easy way, but can't remember why, how it worked, etc.
In principle, any torch model can be converted to Core ML, but there are limitations - converted model is "closed", weights and structure of the model cannot be modified (that's why LoRAs need to be applied beforehand). As I understand, applying the motion model modifies the model (can't remember how exactly), so any injections must happen before conversion.
Perhaps a new torch model has to be implemented for this to work and to be worth the effort (it has to be ANE compatibile). Currently I don't have enough knowledge to do this, but if I find some time, and no one else provides any solution by then, I'll try to dive deeper into this subject and see what I can come up with.
Cheers
I am a noob admittedly when it comes to programming, so I may be above my head / punching above my weight (pun intended)
I am wondering / attempting if itβs possible to modify the following node:
` class AnimateDiffLoaderWithContext: @classmethod def INPUT_TYPES(s): return { "required": { "model": ("MODEL",), "model_name": (get_available_motion_models(),), "beta_schedule": (BetaSchedules.get_alias_list_with_first_element(BetaSchedules.SQRT_LINEAR),),
"apply_mm_groupnorm_hack": ("BOOLEAN", {"default": True}),
β https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved/blob/main/animatediff/nodes.py
I was analyzing how you did the CoreMLSampler from KSampler, and I first attempted to convert a safetensor motion module file to .mlmodelc format, but to no avail. (https://huggingface.co/CiaraRowles/TemporalDiff/blob/main/temporaldiff-v1-animatediff.safetensors)
Thank you for your time and attention