butaixianran 803d44c474
Fix None type error for TI module
When user using model_name.png as a preview image, textural_inversion.py still treat it as an embeding, and didn't handle its error, just let python throw out an None type error like following:
```bash
  File "D:\Work\Dev\AI\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 155, in load_from_file
    name = data.get('name', name)
AttributeError: 'NoneType' object has no attribute 'get'
```

With just a simple `if data:` checking as following, there will be no error, breaks nothing, and now this module can works fine with user's preview images.
Old code:  
```python
                data = extract_image_data_embed(embed_image)
                name = data.get('name', name)
```
New code:  
```python
                data = extract_image_data_embed(embed_image)
                if data:
                    name = data.get('name', name)
                else:
                    # if data is None, means this is not an embeding, just a preview image
                    return
```

Also, since there is no more errors on textual inversion module, from now on, extra network can set "model_name.png" as preview image for embedings.
2023-03-25 02:05:00 +08:00
..
2023-03-11 14:34:56 -05:00
2023-03-13 12:35:30 -04:00
2023-02-08 07:08:09 -05:00
2022-11-17 00:08:21 -05:00
2023-02-25 19:15:06 +00:00
2023-01-21 08:36:07 +03:00
2022-09-07 12:32:28 +03:00
2023-02-04 11:38:56 +03:00
2023-03-12 12:36:04 -07:00
2023-02-08 07:03:36 -05:00
2022-12-14 20:59:33 +02:00
2023-01-19 09:25:37 +03:00
2023-01-07 01:46:13 +03:00
2023-02-08 07:10:13 -05:00
2022-12-31 18:06:35 +03:00
2023-03-10 22:48:41 +05:00
2023-03-12 09:19:23 -04:00
2022-11-30 14:56:12 +08:00