Repository: stable-diffusion-webui
Issue: [Bug]: XYZ Plotting - Individual images from grid save to one folder when multiple checkpoints are used and model_name is specified.
Labels: bug-report

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

The generated folder's model_name is the currently loaded checkpoint, as opposed to the checkpoints respective to each image generated by XYZ plotting.

Images generated normally save to proper folders. Issue is only with XYZ/grid.

Thank you.

### Steps to reproduce the problem

1. Use XYZ plotting to compare multiple checkpoints.
2. Have the "include subimages" checked.
3. Save individual images with save icon.
4. Saved images go into single folder, as opposed to separate ones.

### What should have happened?

Hitting the save icon should save the images to appropriate separate folders based on their respective checkpoints.

### Sysinfo

[sysinfo-2023-10-13-09-16.txt](https://github.com/AUTOMATIC1111/stable-diffusion-webui/files/12891860/sysinfo-2023-10-13-09-16.txt)


### What browsers do you use to access the UI ?

Google Chrome

### Console logs

```Shell
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
Launching Web UI with arguments: --precision full --no-half-vae --no-half --opt-sdp-attention
No module 'xformers'. Proceeding without it.
2023-10-13 01:39:01,370 - ControlNet - INFO - ControlNet v1.1.410
ControlNet preprocessor location: D:\TEMP\Stable Diffusion\sd.webui\webui\extensions\sd-webui-controlnet\annotator\downloads
2023-10-13 01:39:01,495 - ControlNet - INFO - ControlNet v1.1.410
Loading weights [59ffe2243a] from D:\TEMP\Stable Diffusion\sd.webui\webui\models\Stable-diffusion\chilloutmix_NiPrunedFp16Fix.safetensors
Creating model from config: D:\TEMP\Stable Diffusion\sd.webui\webui\configs\v1-inference.yaml
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 15.2s (prepare environment: 4.4s, import torch: 3.3s, import gradio: 1.1s, setup paths: 1.0s, initialize shared: 0.2s, other imports: 0.9s, setup codeformer: 0.2s, load scripts: 2.8s, create ui: 1.0s, gradio launch: 0.3s).
Loading VAE weights specified in settings: D:\TEMP\Stable Diffusion\sd.webui\webui\models\VAE\vae-ft-mse-840000-ema-pruned.safetensors
Applying attention optimization: sdp... done.
Model loaded in 12.8s (load weights from disk: 1.0s, create model: 0.6s, apply weights to model: 5.4s, apply float(): 2.8s, load VAE: 0.9s, calculate empty prompt: 2.0s).
Traceback (most recent call last):
  File "D:\TEMP\Stable Diffusion\sd.webui\system\python\lib\site-packages\gradio\routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "D:\TEMP\Stable Diffusion\sd.webui\system\python\lib\site-packages\gradio\blocks.py", line 1431, in process_api
    result = await self.call_function(
  File "D:\TEMP\Stable Diffusion\sd.webui\system\python\lib\site-packages\gradio\blocks.py", line 1103, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "D:\TEMP\Stable Diffusion\sd.webui\system\python\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "D:\TEMP\Stable Diffusion\sd.webui\system\python\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "D:\TEMP\Stable Diffusion\sd.webui\system\python\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "D:\TEMP\Stable Diffusion\sd.webui\system\python\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "D:\TEMP\Stable Diffusion\sd.webui\webui\modules\ui_extra_networks.py", line 392, in pages_html
    return refresh()
  File "D:\TEMP\Stable Diffusion\sd.webui\webui\modules\ui_extra_networks.py", line 400, in refresh
    ui.pages_contents = [pg.create_html(ui.tabname) for pg in ui.stored_extra_pages]
  File "D:\TEMP\Stable Diffusion\sd.webui\webui\modules\ui_extra_networks.py", line 400, in <listcomp>
    ui.pages_contents = [pg.create_html(ui.tabname) for pg in ui.stored_extra_pages]
  File "D:\TEMP\Stable Diffusion\sd.webui\webui\modules\ui_extra_networks.py", line 162, in create_html
    self.items = {x["name"]: x for x in self.list_items()}
  File "D:\TEMP\Stable Diffusion\sd.webui\webui\modules\ui_extra_networks.py", line 162, in <dictcomp>
    self.items = {x["name"]: x for x in self.list_items()}
  File "D:\TEMP\Stable Diffusion\sd.webui\webui\modules\ui_extra_networks_checkpoints.py", line 35, in list_items
    yield self.create_item(name, index)
  File "D:\TEMP\Stable Diffusion\sd.webui\webui\modules\ui_extra_networks_checkpoints.py", line 18, in create_item
    path, ext = os.path.splitext(checkpoint.filename)
AttributeError: 'NoneType' object has no attribute 'filename'
Reusing loaded model chilloutmix_NiPrunedFp16Fix.safetensors [59ffe2243a] to load protogenV22Anime_protogenV22.safetensors
Calculating sha256 for D:\TEMP\Stable Diffusion\sd.webui\webui\models\Stable-diffusion\protogenV22Anime_protogenV22.safetensors: b4d453442af7124bb12832a4450f4f120452f479c0212e0924d34cfbe580ba42
Loading weights [b4d453442a] from D:\TEMP\Stable Diffusion\sd.webui\webui\models\Stable-diffusion\protogenV22Anime_protogenV22.safetensors
Loading VAE weights specified in settings: D:\TEMP\Stable Diffusion\sd.webui\webui\models\VAE\vae-ft-mse-840000-ema-pruned.safetensors
Applying attention optimization: sdp... done.
Weights loaded in 12.0s (send model to cpu: 1.6s, calculate hash: 4.7s, load weights from disk: 0.7s, apply weights to model: 2.8s, load VAE: 0.7s, move model to device: 1.3s).
Restarting UI...
Closing server running on port: 7860
2023-10-13 01:42:13,617 - ControlNet - INFO - ControlNet v1.1.410
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 1.3s (load scripts: 0.4s, create ui: 0.7s, gradio launch: 0.1s).
Restarting UI...
Closing server running on port: 7860
2023-10-13 01:43:34,639 - ControlNet - INFO - ControlNet v1.1.410
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 0.9s (load scripts: 0.3s, create ui: 0.5s, gradio launch: 0.1s).
Reusing loaded model protogenV22Anime_protogenV22.safetensors [b4d453442a] to load chilloutmix_NiPrunedFp16Fix.safetensors [59ffe2243a]
Loading weights [59ffe2243a] from D:\TEMP\Stable Diffusion\sd.webui\webui\models\Stable-diffusion\chilloutmix_NiPrunedFp16Fix.safetensors
Loading VAE weights specified in settings: D:\TEMP\Stable Diffusion\sd.webui\webui\models\VAE\vae-ft-mse-840000-ema-pruned.safetensors
Applying attention optimization: sdp... done.
Weights loaded in 6.5s (send model to cpu: 1.3s, load weights from disk: 0.3s, apply weights to model: 2.7s, load VAE: 0.7s, move model to device: 1.4s).
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:34<00:00,  1.73s/it]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [01:03<00:00,  3.17s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:27<00:00,  1.39s/it]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [00:29<00:00,  1.49s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:27<00:00,  1.39s/it]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [00:29<00:00,  1.48s/it]
Reusing loaded model chilloutmix_NiPrunedFp16Fix.safetensors [59ffe2243a] to load protogenV22Anime_protogenV22.safetensors [b4d453442a]
Loading weights [b4d453442a] from D:\TEMP\Stable Diffusion\sd.webui\webui\models\Stable-diffusion\protogenV22Anime_protogenV22.safetensors
Loading VAE weights specified in settings: D:\TEMP\Stable Diffusion\sd.webui\webui\models\VAE\vae-ft-mse-840000-ema-pruned.safetensors
Applying attention optimization: sdp... done.
Weights loaded in 8.2s (send model to cpu: 1.7s, load weights from disk: 0.3s, apply weights to model: 2.7s, load VAE: 0.9s, hijack: 0.1s, move model to device: 2.5s).
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:29<00:00,  1.49s/it]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [00:30<00:00,  1.50s/it]
Reusing loaded model protogenV22Anime_protogenV22.safetensors [b4d453442a] to load chilloutmix_NiPrunedFp16Fix.safetensors [59ffe2243a]
Loading weights [59ffe2243a] from D:\TEMP\Stable Diffusion\sd.webui\webui\models\Stable-diffusion\chilloutmix_NiPrunedFp16Fix.safetensors
Loading VAE weights specified in settings: D:\TEMP\Stable Diffusion\sd.webui\webui\models\VAE\vae-ft-mse-840000-ema-pruned.safetensors
Applying attention optimization: sdp... done.
Weights loaded in 7.9s (send model to cpu: 1.5s, load weights from disk: 0.4s, apply weights to model: 3.0s, load VAE: 0.7s, move model to device: 2.2s).
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:35<00:00,  1.76s/it]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [01:04<00:00,  3.21s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:27<00:00,  1.39s/it]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [00:29<00:00,  1.49s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:27<00:00,  1.39s/it]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [00:29<00:00,  1.49s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:37<00:00,  1.86s/it]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [00:29<00:00,  1.50s/it]
Reusing loaded model chilloutmix_NiPrunedFp16Fix.safetensors [59ffe2243a] to load deliberate_v3.safetensors,  1.41s/it]
Calculating sha256 for D:\TEMP\Stable Diffusion\sd.webui\webui\models\Stable-diffusion\deliberate_v3.safetensors: aadddd3d7579de79db91f4ac03f2fbad4e9b71216bbebb50c338cae74b77cb27
Loading weights [aadddd3d75] from D:\TEMP\Stable Diffusion\sd.webui\webui\models\Stable-diffusion\deliberate_v3.safetensors
Loading VAE weights specified in settings: D:\TEMP\Stable Diffusion\sd.webui\webui\models\VAE\vae-ft-mse-840000-ema-pruned.safetensors
Applying attention optimization: sdp... done.
Weights loaded in 11.1s (send model to cpu: 1.5s, calculate hash: 5.5s, load weights from disk: 0.4s, apply weights to model: 1.7s, load VAE: 0.7s, move model to device: 1.3s).
X/Y/Z plot will create 8 images on 1 2x4 grid. (Total steps to process: 240)
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [01:24<00:00,  2.80s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [01:23<00:00,  2.79s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [01:23<00:00,  2.80s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [01:24<00:00,  2.80s/it]
Reusing loaded model deliberate_v3.safetensors [aadddd3d75] to load dreamshaper_8.safetensors [879db523c3]1,  2.85s/it]
Loading weights [879db523c3] from D:\TEMP\Stable Diffusion\sd.webui\webui\models\Stable-diffusion\dreamshaper_8.safetensors
Loading VAE weights specified in settings: D:\TEMP\Stable Diffusion\sd.webui\webui\models\VAE\vae-ft-mse-840000-ema-pruned.safetensors
Applying attention optimization: sdp... done.
Weights loaded in 8.1s (send model to cpu: 1.5s, load weights from disk: 0.4s, apply weights to model: 3.1s, load VAE: 0.7s, move model to device: 2.2s).
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [01:25<00:00,  2.85s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [01:24<00:00,  2.80s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [01:24<00:00,  2.81s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [01:24<00:00,  2.82s/it]
Reusing loaded model dreamshaper_8.safetensors [879db523c3] to load deliberate_v3.safetensors [aadddd3d75]0,  2.87s/it]
Loading weights [aadddd3d75] from D:\TEMP\Stable Diffusion\sd.webui\webui\models\Stable-diffusion\deliberate_v3.safetensors
Loading VAE weights specified in settings: D:\TEMP\Stable Diffusion\sd.webui\webui\models\VAE\vae-ft-mse-840000-ema-pruned.safetensors
Applying attention optimization: sdp... done.
Weights loaded in 10.8s (send model to cpu: 2.5s, load weights from disk: 0.7s, apply weights to model: 3.8s, load VAE: 1.0s, move model to device: 2.7s).
Total progress: 100%|████████████████████████████████████████████████████████████████| 240/240 [12:01<00:00,  3.01s/it]
```


### Additional information

_No response_