stable-diffusion-webui/modules
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
..
api small diff whitespace cleanup 2023-03-11 14:34:56 -05:00
codeformer
hypernetworks Merge branch 'master' into weighted-learning 2023-02-19 12:41:29 +03:00
models/diffusion add pbar to unipc 2023-03-13 12:35:30 -04:00
textual_inversion Fix None type error for TI module 2023-03-25 02:05:00 +08:00
call_queue.py
codeformer_model.py Filter out temporary files that will be generated if the download fails. 2023-02-24 00:42:29 +08:00
deepbooru_model.py
deepbooru.py
devices.py
errors.py
esrgan_model_arch.py add missing import 2023-02-08 07:08:09 -05:00
esrgan_model.py
extensions.py git 3.1.30 api change 2023-02-25 19:15:06 +00:00
extra_networks_hypernet.py
extra_networks.py
extras.py
face_restoration.py
generation_parameters_copypaste.py Merge pull request #7818 from space-nuko/extension-paste-field-names 2023-03-11 16:44:20 +03:00
gfpgan_model.py
hashes.py add --no-hashing 2023-02-04 11:38:56 +03:00
images.py update fullfn properly 2023-03-12 12:36:04 -07:00
img2img.py convert rgba to rgb 2023-02-08 07:03:36 -05:00
import_hook.py
interrogate.py
localization.py
lowvram.py
mac_specific.py Remove test, use bool tensor fix by default 2023-03-11 17:35:17 -05:00
masking.py
memmon.py attempt to fix memory monitor with multiple CUDA devices 2023-03-12 21:04:17 +03:00
modelloader.py use lowercase name for sorting; keep UpscalerLanczos and UpscalerNearest at the start of the list with UpscalerNone 2023-03-06 13:21:42 -05:00
ngrok.py
paths.py
postprocessing.py
processing.py initialize extra_network_data before use 2023-03-13 17:37:29 +02:00
progress.py
prompt_parser.py
realesrgan_model.py
safe.py
script_callbacks.py rename CFGDenoiserParams fields for #8064 2023-03-11 14:52:29 +03:00
script_loading.py
scripts_auto_postprocessing.py
scripts_postprocessing.py
scripts.py Merge pull request #7818 from space-nuko/extension-paste-field-names 2023-03-11 16:44:20 +03:00
sd_disable_initialization.py make it possible to load SD1 checkpoints without CLIP 2023-02-05 11:21:00 +03:00
sd_hijack_checkpoint.py
sd_hijack_clip_old.py
sd_hijack_clip.py
sd_hijack_inpainting.py add missing import 2023-02-08 07:10:13 -05:00
sd_hijack_ip2p.py
sd_hijack_open_clip.py
sd_hijack_optimizations.py sdp_attnblock_forward hijack 2023-03-10 22:48:41 +05:00
sd_hijack_unet.py Apply hijacks in ddpm_edit for upcast sampling 2023-02-07 22:53:45 -05:00
sd_hijack_utils.py
sd_hijack_xlmr.py
sd_hijack.py sdp_attnblock_forward hijack 2023-03-10 22:48:41 +05:00
sd_models_config.py
sd_models.py fix an error loading Lora with empty values in metadata 2023-03-14 11:22:29 +03:00
sd_samplers_common.py
sd_samplers_compvis.py add UniPC options to infotext 2023-03-11 12:09:36 +03:00
sd_samplers_kdiffusion.py rename CFGDenoiserParams fields for #8064 2023-03-11 14:52:29 +03:00
sd_samplers.py UniPC does not support img2img (for now) 2023-02-10 05:00:54 -08:00
sd_vae_approx.py modules/sd_vae_approx.py: fix VAE-approx path 2023-03-11 20:00:12 +08:00
sd_vae.py
shared_items.py remove unneeded return from #7583 2023-02-19 12:23:40 +03:00
shared.py force refresh tqdm before close 2023-03-12 09:19:23 -04:00
styles.py
sub_quadratic_attention.py
timer.py display correct timings after restarting UI 2023-03-12 21:25:22 +03:00
txt2img.py
ui_common.py Allow extensions to declare paste fields for "Send to X" buttons 2023-02-14 03:55:42 -08:00
ui_components.py
ui_extensions.py change extension index link to the new dedicated repo instead of wiki 2023-03-12 17:20:17 +03:00
ui_extra_networks_checkpoints.py save previews for extra networks in the selected format 2023-03-11 15:46:20 +03:00
ui_extra_networks_hypernets.py save previews for extra networks in the selected format 2023-03-11 15:46:20 +03:00
ui_extra_networks_textual_inversion.py save previews for extra networks in the selected format 2023-03-11 15:46:20 +03:00
ui_extra_networks.py Update ui_extra_networks.py 2023-03-14 15:36:08 +09:00
ui_postprocessing.py
ui_tempdir.py
ui.py Merge pull request #8492 from zhanghua000/absolute-path 2023-03-12 08:55:15 +03:00
upscaler.py
xlmr.py