mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-21 07:30:02 +08:00
803d44c474
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. |
||
---|---|---|
.. | ||
api | ||
codeformer | ||
hypernetworks | ||
models/diffusion | ||
textual_inversion | ||
call_queue.py | ||
codeformer_model.py | ||
deepbooru_model.py | ||
deepbooru.py | ||
devices.py | ||
errors.py | ||
esrgan_model_arch.py | ||
esrgan_model.py | ||
extensions.py | ||
extra_networks_hypernet.py | ||
extra_networks.py | ||
extras.py | ||
face_restoration.py | ||
generation_parameters_copypaste.py | ||
gfpgan_model.py | ||
hashes.py | ||
images.py | ||
img2img.py | ||
import_hook.py | ||
interrogate.py | ||
localization.py | ||
lowvram.py | ||
mac_specific.py | ||
masking.py | ||
memmon.py | ||
modelloader.py | ||
ngrok.py | ||
paths.py | ||
postprocessing.py | ||
processing.py | ||
progress.py | ||
prompt_parser.py | ||
realesrgan_model.py | ||
safe.py | ||
script_callbacks.py | ||
script_loading.py | ||
scripts_auto_postprocessing.py | ||
scripts_postprocessing.py | ||
scripts.py | ||
sd_disable_initialization.py | ||
sd_hijack_checkpoint.py | ||
sd_hijack_clip_old.py | ||
sd_hijack_clip.py | ||
sd_hijack_inpainting.py | ||
sd_hijack_ip2p.py | ||
sd_hijack_open_clip.py | ||
sd_hijack_optimizations.py | ||
sd_hijack_unet.py | ||
sd_hijack_utils.py | ||
sd_hijack_xlmr.py | ||
sd_hijack.py | ||
sd_models_config.py | ||
sd_models.py | ||
sd_samplers_common.py | ||
sd_samplers_compvis.py | ||
sd_samplers_kdiffusion.py | ||
sd_samplers.py | ||
sd_vae_approx.py | ||
sd_vae.py | ||
shared_items.py | ||
shared.py | ||
styles.py | ||
sub_quadratic_attention.py | ||
timer.py | ||
txt2img.py | ||
ui_common.py | ||
ui_components.py | ||
ui_extensions.py | ||
ui_extra_networks_checkpoints.py | ||
ui_extra_networks_hypernets.py | ||
ui_extra_networks_textual_inversion.py | ||
ui_extra_networks.py | ||
ui_postprocessing.py | ||
ui_tempdir.py | ||
ui.py | ||
upscaler.py | ||
xlmr.py |