o yf@sddlZddlZddlZgZddZddZddZdd Zd d d ed e ddfddZ ddZ d dde fddZ iZde fddZddZddZdS)NcCsddt|DS)NcSs,g|]}|jd|jd|j|jgqS)z, line z, )filenamelinenonameline.0xr _C:\Users\Luke\Documents\Stable diffusion\Automatic1111\stable-diffusion-webui\modules\errors.py s,z$format_traceback..) traceback extract_tb)tbr r r format_traceback srcCst|t|dS)N) exceptionr )strr)err r r format_exception src Cs<ztttWSty}z t|WYd}~Sd}~wwN)listreversedexception_records Exceptionr)rr r r get_exceptionss rcCs\t\}}}|dur dStrtd|krdStt||ttdkr,tddSdS)Nr)sysexc_inforappendrlenpop)_rrr r r record_exceptions r"F)rmessagerreturncCsXt|D] }td|tjdq|r*tttdtjdtdtjddSdS)zD Print an error message to stderr, with optional traceback. z***filez z---N) r" splitlinesprintrstderrtextwrapindentr format_exc)r#rrr r r report&s r-cCsft|d}tdd|D}td|tjd|D] }t|tjdqtd|tjddS)N cSsg|]}t|qSr )rrr r r r 8sz+print_error_explanation..=r%)r"stripsplitmaxr(rr))r#linesZmax_lenrr r r print_error_explanation4sr4)full_tracebackrcCstt|pddt|jtjdtj|}|r+t t dd|j |_ t| dtjdt |}d|vrDtddSdS) Nerrorz: r%)sepr&zxcopying a param with shape torch.Size([640, 1024]) from checkpoint, the shape in current model is torch.Size([640, 768])z The most likely cause of this is you are trying to load Stable Diffusion 2.0 model without specifying its config file. See https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#stable-diffusion-20 for how to solve this. )r"r(type__name__rr)r TracebackExceptionfrom_exception StackSummary extract_stackstackformatrr4)rtaskr5ter#r r r display@s"  rDcCs(t|tvr dSt||dt|<dS)N)r"already_displayedrD)rrBr r r display_onceUs   rGc Cs>z|WdSty}z t||WYd}~dSd}~wwr)rrD)coderBrr r r run`s  rIcCsddlm}ddlm}ddl}ddl}d}d}d}||j||kr3td|jd|d  |j rSddl }||j||krStd |jd |d  |j|krhtd |jd|d dSdS)Nr)version)sharedz2.1.2z 0.0.23.post1z3.41.2z You are running torch z+. The program is tested to work with torch a2. To reinstall the desired version, run with commandline flag --reinstall-torch. Beware that this will cause a lot of large files to be downloaded, as well as there are reports of issues with training tab on the latest version. Use --skip-version-check commandline argument to disable this check. z You are running xformers z.. The program is tested to work with xformers z. To reinstall the desired version, run with commandline flag --reinstall-xformers. Use --skip-version-check commandline argument to disable this check. z You are running gradio z.. The program is designed to work with gradio av. Using a different version of gradio is extremely likely to break the program. Reasons why you have the mismatched gradio version can be: - you use --skip-install flag. - you use webui.py to start the program instead of launch.py. - an extension installs the incompatible gradio version. Use --skip-version-check commandline argument to disable this check. ) packagingrJmodulesrKtorchgradioparse __version__r4r0Zxformers_availablexformers)rJrKrNrOZexpected_torch_versionZexpected_xformers_versionZexpected_gradio_versionrRr r r check_versionsgsD     rS)rr*r rrrrr"rboolr-r4rrDrFrGrIrSr r r r s