InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[enhancement]: `models.yaml` paths should be agnostic to back/forward slashes

Open ebr opened this issue 3 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Contact Details

No response

What should this feature add?

Currently a user might have a models.yaml file with forward slashes in pathnames, because that's how we set it up by default. But when they add .ckpt paths on Windows, they will add paths with backslashes. Our current path parsing logic breaks sometimes, and the users are advised to change their Windows paths to use forward slashes, which is poor UX. We should ensure paths are normalized to the host OS regardless of the slash symbol.

Alternatives

No response

Aditional Content

https://discord.com/channels/1020123559063990373/1049495067846524939/1049751396439838780

https://discord.com/channels/1020123559063990373/1049627748295000084/1049751214352515142

ebr avatar Dec 06 '22 18:12 ebr

I wondered if that was messing things up, but I tried a few things and it doesn't look like backslashes in yaml as long as you don't double-quote them in the yaml file:

>> yaml.safe_load(r'someplace: c:\users\keturn\models\v1.ckpt')

{'someplace': 'c:\\users\\keturn\\models\\v1.ckpt'}

but it is disorienting to see filenames with the slashes backwards from the way the platform describes filenames. I think if we store them as Path, it should write them appropriately?

keturn avatar Dec 06 '22 21:12 keturn

There has been no activity in this issue for 14 days. If this issue is still being experienced, please reply with an updated confirmation that the issue is still being experienced with the latest release.

github-actions[bot] avatar Mar 20 '23 06:03 github-actions[bot]