Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to save new models #9

Open
dege1000 opened this issue Dec 9, 2024 · 0 comments
Open

Unable to save new models #9

dege1000 opened this issue Dec 9, 2024 · 0 comments

Comments

@dege1000
Copy link

dege1000 commented Dec 9, 2024

Hi, I love this merger, nice and fast, but I have a constant issue. I'm unable to save any merge done with this extension, do you happen to know if it is an issue on my end or a bug?

This is the error I'm getting on the console:

Traceback (most recent call last):s/it]
  File "/mnt/external/sd/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "/mnt/external/sd/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1431, in process_api
    result = await self.call_function(
  File "/mnt/external/sd/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1103, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/mnt/external/sd/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/mnt/external/sd/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/mnt/external/sd/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/mnt/external/sd/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "/mnt/external/sd/stable-diffusion-webui/extensions/sd-webui-untitledmerger/scripts/untitled/misc_util.py", line 148, in save_loaded_model
    checkpoint_info = save_state_dict(state_dict,name,settings)
  File "/mnt/external/sd/stable-diffusion-webui/extensions/sd-webui-untitledmerger/scripts/untitled/misc_util.py", line 176, in save_state_dict
    safetensors.torch.save_file(state_dict,filename)
  File "/mnt/external/sd/stable-diffusion-webui/venv/lib/python3.10/site-packages/safetensors/torch.py", line 281, in save_file
    serialize_file(_flatten(tensors), filename, metadata=metadata)
  File "/mnt/external/sd/stable-diffusion-webui/venv/lib/python3.10/site-packages/safetensors/torch.py", line 485, in _flatten
    return {
  File "/mnt/external/sd/stable-diffusion-webui/venv/lib/python3.10/site-packages/safetensors/torch.py", line 489, in <dictcomp>
    "data": _tobytes(v, k),
  File "/mnt/external/sd/stable-diffusion-webui/venv/lib/python3.10/site-packages/safetensors/torch.py", line 403, in _tobytes
    raise ValueError(
ValueError: You are trying to save a non contiguous tensor: `model.diffusion_model.input_blocks.0.0.weight` which is not allowed. It either means you are trying to save tensors which are reference of each other in which case it's recommended to save only the full tensors, and reslice at load time, or simply call `.contiguous()` on your tensor to pack it before saving.

If it helps, I'm running the dev branch of a1111 web ui, on arch linux with a 2060 super, the standard merger works fine and this merger works every thing including generating with the cached mode except saving it to the hard drive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant