diff --git a/README.md b/README.md
index 2ce027cc4..73b78ebed 100644
--- a/README.md
+++ b/README.md
@@ -167,7 +167,7 @@ General goals:
### **Sponsors**
diff --git a/TODO.md b/TODO.md
index f84b578b0..08c7e4655 100644
--- a/TODO.md
+++ b/TODO.md
@@ -12,12 +12,11 @@ Stuff to be fixed, in no particular order...
Stuff to be added, in no particular order...
- Diffusers:
- - Add SD-XL Lora
+ - Add Hires
+ - Add Lora/Lyco mixer
- Add ControlNet
- Fix SD-XL Img2img/Inpaint
- Add SD and SD-XL Pix2Pix
- - Add VAE direct load from safetensors
- - Fix Kandinsky 2.2 model
- Fix DeepFloyd IF model
- Redo Prompt parser for diffusers
- Add unCLIP model
@@ -54,6 +53,7 @@ Stuff to be added, in no particular order...
- Templates for SD-XL training
- Lora train UI
- Redesign
+ - Extensions reporting framework
- New UI
- New inpainting canvas controls (move from backend to purely frontend)
- New image browser (move from backend to purely frontend)
diff --git a/html/locale_en.json b/html/locale_en.json
index 0d2a6cc20..c67068070 100644
--- a/html/locale_en.json
+++ b/html/locale_en.json
@@ -383,6 +383,7 @@
{"id":"","label":"Model compile suppress errors","localized":"","hint":""},
{"id":"","label":"Disable Torch memory garbage collection","localized":"","hint":"Disable Torch memory garbage collection on each generation. CG will still run before & after model load as well when low GPU memory threshold is reached."},
{"id":"","label":"Directory for temporary images; leave empty for default","localized":"","hint":""},
+ {"id":"","label":"Enable IPEX Optimize for Intel GPUs","localized":"","hint":""},
{"id":"","label":"Cleanup non-default temporary directory when starting webui","localized":"","hint":""},
{"id":"","label":"Path to directory with stable diffusion checkpoints","localized":"","hint":""},
{"id":"","label":"Path to directory with stable diffusion diffusers","localized":"","hint":""},
@@ -569,7 +570,7 @@
{"id":"","label":"Use model EMA weights when possible","localized":"","hint":""},
{"id":"","label":"Generator device","localized":"","hint":""},
{"id":"","label":"Enable sequential CPU offload","localized":"","hint":"Reduces GPU memory usage by transferring weights to the CPU. Increases inference time approximately 10%. Use with Enable Attention slicing for minimal memory consumption"},
- {"id":"","label":"Enable model CPU offload","localized":"","hint":"Transferring of entire models to the GPU, negligible impact on inference time while still providing some memory savings. Use with Enable Attention slicing for additional memory savings"},
+ {"id":"","label":"Enable model CPU offload","localized":"","hint":"Transferring of entire models to the CPU, negligible impact on inference time while still providing some memory savings. Use with Enable Attention slicing for additional memory savings"},
{"id":"","label":"Enable VAE slicing","localized":"","hint":"Decodes batch latents one image at a time with limited VRAM. Small performance boost in VAE decode on multi-image batches. Use with Enable Attention slicing"},
{"id":"","label":"Enable VAE tiling","localized":"","hint":"Divide large images into overlapping tiles with limited VRAM. Might result in a minor increase in processing time. Use with Enable Attention Slicing"},
{"id":"","label":"Enable attention slicing","localized":"","hint":"Performs attention computation in steps instead of all at once. 10% slower inference times. Greatly reduces memory usage. Best used, period"},
diff --git a/html/locale_ko.json b/html/locale_ko.json
index f91f7759c..1dc3600e2 100644
--- a/html/locale_ko.json
+++ b/html/locale_ko.json
@@ -16,9 +16,9 @@
{"id":"","label":"Negative prompt","localized":"네거티브 프롬프트","hint":"생성되지 않았으면 하는 이미지의 설명"}
],
"common keywords": [
- {"id":"","label":"fp16","localized":"반정밀도(16비트)","hint":"수를 16비트 부동소수점으로 표현"},
- {"id":"","label":"fp32","localized":"단정밀도(32비트)","hint":"수를 32비트 부동소수점으로 표현"},
- {"id":"","label":"bf16","localized":"혼합 정밀도(16비트 bfloat)","hint":"수를 16비트 혼합 정밀도로 표현"},
+ {"id":"","label":"fp16","localized":"반정밀도(16비트)","hint":"수를 16비트 부동소수점으로 표현한다."},
+ {"id":"","label":"fp32","localized":"단정밀도(32비트)","hint":"수를 32비트 부동소수점으로 표현한다."},
+ {"id":"","label":"bf16","localized":"혼합 정밀도(16비트 bfloat)","hint":"수를 16비트 혼합 정밀도로 표현한다."},
{"id":"","label":"Run","localized":"실행","hint":""},
{"id":"","label":"all","localized":"전체","hint":""},
{"id":"","label":"none","localized":"없음","hint":""},
@@ -55,18 +55,18 @@
{"id":"","label":"UI card preview lazy loading","localized":"UI 카드 프리뷰를 늦게 로드","hint":""},
{"id":"","label":"UI card size (px)","localized":"UI 카드 크기 (px, 픽셀)","hint":""},
{"id":"","label":"UI disable variable aspect ratio","localized":"","hint":""},
- {"id":"","label":"UI image contain method","localized":"","hint":""},
+ {"id":"","label":"UI image contain method","localized":"UI 이미지 표시 방식","hint":""},
{"id":"","label":"Do not automatically build extra network pages","localized":"자동으로 엑스트라 네트워크 페이지를 만들지 않음","hint":""},
{"id":"","label":"Use LyCoris handler for all Lora types","localized":"모든 Lora 종류에 LyCoris 핸들러 사용","hint":""},
{"id":"","label":"Disable built-in Lora handler","localized":"내장 Lora 핸들러 비활성화","hint":""},
- {"id":"","label":"Use Kohya method for handling multiple Loras","localized":"","hint":""},
- {"id":"","label":"Multiplier for extra networks","localized":"엑스트라 네트워크 배율","hint":"하이퍼 네트워크 또는 Lora를 프롬프트에 추가할 때 사용할 배율."},
+ {"id":"","label":"Use Kohya method for handling multiple Loras","localized":"여러 Lora를 다룰 때 Kohya의 방법 사용","hint":""},
+ {"id":"","label":"Multiplier for extra networks","localized":"엑스트라 네트워크 배율","hint":"하이퍼 네트워크 또는 Lora를 프롬프트에 추가할 때 사용할 배율이다."},
{"id":"","label":"Add hypernetwork to prompt","localized":"프롬프트에 하이퍼 네트워크 추가","hint":""},
{"id":"","label":"Add Lora to prompt","localized":"프롬프트에 Lora 추가","hint":""},
{"id":"","label":"shuffle tags by ',' when creating prompts.","localized":"프롬프트를 생성할 때 ','에 따라 태그 섞기","hint":""},
- {"id":"","label":"extra text to add before <...> when adding extra network to prompt","localized":"","hint":""},
+ {"id":"","label":"extra text to add before <...> when adding extra network to prompt","localized":"엑스트라 네트워크를 프롬프트에 추가할 때 <...> 이전에 추가할 텍스트","hint":""},
{"id":"","label":"When adding to prompt, refer to Lora by","localized":"","hint":""},
- {"id":"","label":"add lora hashes to infotext","localized":"","hint":""},
+ {"id":"","label":"add lora hashes to infotext","localized":"infotext에 Lora 해시 정보 포함","hint":""},
{"id":"","label":"Checkpoints","localized":"체크포인트","hint":""},
{"id":"","label":"Lora","localized":"","hint":""},
{"id":"","label":"LyCORIS","localized":"","hint":""},
@@ -83,9 +83,9 @@
{"id":"","label":"delete","localized":"삭제","hint":"이미지를 삭제한다."},
{"id":"","label":"➠ text","localized":"➠ 텍스트","hint":"이미지를 이미지➠텍스트 탭으로 옮긴다."},
{"id":"","label":"➠ image","localized":"➠ 이미지","hint":"이미지를 이미지➠이미지 탭으로 옮긴다."},
- {"id":"","label":"➠ inpaint","localized":"","hint":"Transfer image to inpaint interface"},
- {"id":"","label":"➠ sketch","localized":"","hint":"Transfer image to sketch interface"},
- {"id":"","label":"➠ inpaint sketch","localized":"","hint":"Transfer image to inpaint sketch interface"},
+ {"id":"","label":"➠ inpaint","localized":"➠ 인페인트","hint":"이미지를 인페인트 화면으로 옮긴다."},
+ {"id":"","label":"➠ sketch","localized":"➠ 스케치","hint":"이미지를 스케치 화면으로 옮긴다."},
+ {"id":"","label":"➠ inpaint sketch","localized":"➠ 인페인트 스케치","hint":"이미지를 인페인트 스케치 탭으로 옮긴다."},
{"id":"","label":"➠ process","localized":"➠ 이미지 정보","hint":"이미지를 이미지 정보 탭으로 옮긴다."}
],
"extensions": [
@@ -102,24 +102,24 @@
{"id":"","label":"Apply changes & restart server","localized":"변경 사항을 저장하고 서버를 재시작","hint":"모든 변경 사항을 적용하고 서버를 재시작한다."},
{"id":"","label":"install","localized":"설치","hint":"이 확장을 설치한다."},
{"id":"","label":"uninstall","localized":"제거","hint":"이 확장을 제거한다."},
- {"id":"","label":"User interface defaults","localized":"사용자 인터페이스 기본값","hint":"Review and set current values as default values for the user interface"},
- {"id":"","label":"View changes","localized":"변경 사항 확인","hint":"Review changes between default user interface values and and current values"},
- {"id":"","label":"Set new defaults","localized":"새 기본값 설정","hint":"Set current values as default values for the user interface"},
+ {"id":"","label":"User interface defaults","localized":"유저 인터페이스 기본값","hint":"Review and set current values as default values for the user interface"},
+ {"id":"","label":"View changes","localized":"변경 사항 확인","hint":"기본값과 현재 값 간의 변경 사항을 확인한다."},
+ {"id":"","label":"Set new defaults","localized":"새 기본값 설정","hint":"현재 UI 설정을 기본값으로 저장한다."},
{"id":"","label":"Restore system defaults","localized":"시스템 기본값 복원","hint":"유저 인터페이스 기본값을 복원한다."}
],
"txt2img tab": [
{"id":"","label":"Sampling method","localized":"샘플링 방법(샘플러)","hint":"이미지 생성 시 사용할 알고리즘을 지정한다."},
{"id":"","label":"Sampling steps","localized":"샘플링 스탭 수","hint":"이미지를 생성 과정을 얼마나 많이 반복할지 지정한다. 높을 수록 생성이 길어지고 낮을 수록 결과물 퀄리티가 낮아진다."},
- {"id":"","label":"Restore faces","localized":"얼굴 복원","hint":"Use a pre-trained model to correct the generated faces. See GFPGAN or Codeformer."},
+ {"id":"","label":"Restore faces","localized":"얼굴 복원","hint":"생성된 이미지의 얼굴을 GFPGAN 또는 CodeFormer로 고친다."},
{"id":"","label":"Tiling","localized":"타일링","hint":"Produce an image that can be tiled"},
{"id":"","label":"Hires fix","localized":"생성 후 업스케일(Hires fix)","hint":"최종 이미지를 생성하기 전에 업스케일한다."},
- {"id":"","label":"Denoising strength","localized":"디노이즈 강도","hint":"Determines how little respect the algorithm should have for image's content. At 0, nothing will change, and at 1 you'll get an unrelated image. With values below 1.0, processing will take less steps than the Sampling Steps slider specifies"},
+ {"id":"","label":"Denoising strength","localized":"디노이즈 강도","hint":"기존 이미지의 특징을 얼마나 남길지 정한다. 만약 0이라면 이전 이미지가 그대로 생성되고 1이라면 이전 이미지와 전혀 무관한 이미지가 생성된다. With values below 1.0, processing will take less steps than the Sampling Steps slider specifies"},
{"id":"","label":"Denoise start","localized":"","hint":"Override denoise strength by stating how early base model should finish and when refiner should start. Only applicable to refiner usage. If set to 0 or 1, denoising strength will be used"},
- {"id":"","label":"Hires steps","localized":"업스케일 스탭 수","hint":"Number of sampling steps for upscaled picture. If 0, uses same as for original"},
- {"id":"","label":"Upscaler","localized":"업스케일러","hint":"Which pre-tarined model to use for the upscaling process."},
- {"id":"","label":"Upscale by","localized":"업스케일 배율","hint":"Adjusts the size of the image by multiplying the original width and height by the selected value. Ignored if either Resize width to or Resize height to are non-zero"},
- {"id":"","label":"Resize width to","localized":"너비","hint":"이 너비로 이미지를 리사이즈한다. If 0, width is inferred from either of two nearby sliders"},
- {"id":"","label":"Resize height to","localized":"높이","hint":"이 높이로 이미지를 리사이즈한다. If 0, height is inferred from either of two nearby sliders"},
+ {"id":"","label":"Hires steps","localized":"업스케일 스탭 수","hint":"업스케일 시 샘플링 스탭 수이다. If 0, uses same as for original"},
+ {"id":"","label":"Upscaler","localized":"업스케일러","hint":"업스케일 시 사용할 모델이다."},
+ {"id":"","label":"Upscale by","localized":"업스케일 배율","hint":"기존 이미지의 너비와 높이에 이 값을 곱한다. 너비와 높이가 0이 아니라면 무시된다."},
+ {"id":"","label":"Resize width to","localized":"너비","hint":"이 너비로 이미지를 리사이즈한다. 0이라면 높이에서 추론한다."},
+ {"id":"","label":"Resize height to","localized":"높이","hint":"이 높이로 이미지를 리사이즈한다. 0이라면 너비에서 추론한다."},
{"id":"","label":"Secondary sampler","localized":"2단계 샘플러","hint":"Use specific sampler as fallback sampler if primary is not supported for specific operation"},
{"id":"","label":"Secondary steps","localized":"2단계 스탭 수","hint":"Number of steps to use for second pass"},
{"id":"","label":"Secondary CFG Scale","localized":"2단계 CFG 스케일","hint":"CFG scale used for refiner pass"},
@@ -132,24 +132,24 @@
{"id":"","label":"Batch size","localized":"배치 사이즈","hint":"How many image to create in a single batch (생성 시 성능에 영향을 주고 VRAM을 더 사용함)"},
{"id":"","label":"CFG Scale","localized":"CFG 스케일","hint":"Classifier Free Guidance scale: how strongly the image should conform to prompt. Lower values produce more creative results, higher values make it follow the prompt more strictly; recommended values between 5-10"},
{"id":"","label":"CLIP skip","localized":"클립(CLIP) 스킵","hint":"Clip skip is a feature that allows users to control the level of specificity of the prompt, the higher the CLIP skip value, the less deep the prompt will be interpreted. CLIP Skip 1 is typical while some anime models produce better results at CLIP skip 2"},
- {"id":"","label":"Seed","localized":"시드","hint":"Random Number Generator의 결과를 결정하는 값. 같은 설정 값과 시드를 사용하면 같은 결과를 얻는다."},
+ {"id":"","label":"Seed","localized":"시드","hint":"난수 생성기의 결과를 결정하는 값. 같은 설정 값과 시드를 사용하면 같은 결과를 얻는다."},
{"id":"","label":"Extra","localized":"기타","hint":"추가 설정을 본다."},
- {"id":"","label":"Variation seed","localized":"","hint":"Seed of a different picture to be mixed into the generation"},
- {"id":"","label":"Variation strength","localized":"","hint":"How strong of a variation to produce. At 0, there will be no effect. At 1, you will get the complete picture with variation seed (except for ancestral samplers, where you will just get something)"},
+ {"id":"","label":"Variation seed","localized":"다양성 시드","hint":"Seed of a different picture to be mixed into the generation"},
+ {"id":"","label":"Variation strength","localized":"다양성 강도","hint":"How strong of a variation to produce. At 0, there will be no effect. At 1, you will get the complete picture with variation seed (except for ancestral samplers, where you will just get something)"},
{"id":"","label":"Resize seed from width","localized":"","hint":"Make an attempt to produce a picture similar to what would have been produced with same seed at specified resolution"},
{"id":"","label":"Resize seed from height","localized":"","hint":"Make an attempt to produce a picture similar to what would have been produced with same seed at specified resolution"},
{"id":"","label":"Override settings","localized":"설정 덮어쓰기","hint":"If you read in generation parameters through 'Process Image tab' and individual generation parameters should deviate from your system settings, this box will be populated with those settings to override your system configuration for this workflow"}
],
"process tab": [
- {"id":"","label":"Single Image","localized":"단일 이미지","hint":"Process single image"},
- {"id":"","label":"Process Batch","localized":"배치 생성","hint":"Process batch of images"},
- {"id":"","label":"Process Folder","localized":"폴더 생성","hint":"Process all images in a folder"},
- {"id":"","label":"Scale by","localized":"리사이즈(배율)","hint":"Use this tab to resize the source image(s) by a chosen factor"},
- {"id":"","label":"Scale to","localized":"리사이즈","hint":"Use this tab to resize the source image(s) to a chosen target size"},
+ {"id":"","label":"Single Image","localized":"단일 이미지","hint":"단일 이미지에 대해 작업을 수행한다."},
+ {"id":"","label":"Process Batch","localized":"배치 생성","hint":"이미지 배치를 생성한다."},
+ {"id":"","label":"Process Folder","localized":"폴더","hint":"폴더 내 모든 이미지를 대상으로 작업을 수행한다."},
+ {"id":"","label":"Scale by","localized":"이미지 크기 변경(배율)","hint":"이 배율만큼 이미지 크기를 바꾼다."},
+ {"id":"","label":"Scale to","localized":"이미지 크기 변경","hint":"특정 크기로 이미지 크기를 바꾼다."},
{"id":"","label":"Input directory","localized":"입력 위치","hint":"Folder where the images are that you want to process"},
{"id":"","label":"Output directory","localized":"출력 위치","hint":"Folder where the processed images should be saved to"},
{"id":"","label":"Show result images","localized":"결과 이미지 보기","hint":"Enable to show the processed images in the image pane"},
- {"id":"","label":"Resize","localized":"리사이즈 배율","hint":"Factor for resizing 1x mean no upscale, 4x means 4 times upscale, high values might lead to memory issues on small graphics cards"},
+ {"id":"","label":"Resize","localized":"이미지 크기 변경 배율","hint":"Factor for resizing 1x mean no upscale, 4x means 4 times upscale, high values might lead to memory issues on small graphics cards"},
{"id":"","label":"Crop to fit","localized":"","hint":"If the dimensions of your source image (e.g. 512x510) deviate from your target dimensions (e.g. 1024x768) this function will fit your upscaled image into your target size image. Excess will be cropped"},
{"id":"","label":"Secondary Upscaler","localized":"2단계 업스케일러","hint":"Select secondary upscaler to run after initial upscaler"},
{"id":"","label":"Upscaler 2 visibility","localized":"","hint":"Strength of the secondary upscaler"},
@@ -163,8 +163,8 @@
{"id":"shutdown_submit","label":"Shutdown server","localized":"서버 종료","hint":"서버를 종료한다."},
{"id":"settings_preview_theme","label":"Preview theme","localized":"테마 미리보기","hint":"테마 미리보기 탭을 연다."},
{"id":"defaults_submit","label":"Restore defaults","localized":"기본값 복원","hint":"기본 설정을 불러온다."},
- {"id":"sett_unload_sd_model","label":"Unload checkpoint","localized":"체크포인트 언로드","hint":"현재 로드된 모델을 언로드한다."},
- {"id":"sett_reload_sd_model","label":"Reload checkpoint","localized":"체크포인트 다시 불러오기","hint":"현재 로드된 모델을 다시 불러온다."}
+ {"id":"sett_unload_sd_model","label":"Unload checkpoint","localized":"체크포인트 언로드","hint":"현재 모델을 메모리에서 해제한다."},
+ {"id":"sett_reload_sd_model","label":"Reload checkpoint","localized":"체크포인트 다시 불러오기","hint":"현재 모델을 다시 불러온다."}
],
"settings sections": [
{"id":"","label":"Stable Diffusion","localized":"","hint":""},
@@ -189,11 +189,11 @@
],
"img2img tabs": [
{"id":"","label":"Image","localized":"이미지","hint":""},
- {"id":"","label":"Sketch","localized":"","hint":""},
- {"id":"","label":"Inpaint","localized":"","hint":""},
- {"id":"","label":"Inpaint sketch","localized":"","hint":""},
- {"id":"","label":"Inpaint upload","localized":"","hint":""},
- {"id":"","label":"Batch","localized":"","hint":""}
+ {"id":"","label":"Sketch","localized":"스케치","hint":""},
+ {"id":"","label":"Inpaint","localized":"인페인트","hint":""},
+ {"id":"","label":"Inpaint sketch","localized":"인페인트 스케치","hint":""},
+ {"id":"","label":"Inpaint upload","localized":"인페인트 업로드","hint":""},
+ {"id":"","label":"Batch","localized":"배치","hint":""}
],
"img2img tab": [
{"id":"","label":"Inpaint batch input directory","localized":"","hint":""},
@@ -259,7 +259,7 @@
{"id":"","label":"Name","localized":"이름","hint":""},
{"id":"","label":"Initialization text","localized":"","hint":"If the number of tokens is more than the number of vectors, some may be skipped.\nLeave the textbox empty to start with zeroed out vectors"},
{"id":"","label":"Number of vectors per token","localized":"","hint":""},
- {"id":"","label":"Overwrite Old Embedding","localized":"","hint":""},
+ {"id":"","label":"Overwrite Old Embedding","localized":"기존 임베딩 덮어쓰기","hint":""},
{"id":"","label":"Enter hypernetwork layer structure","localized":"","hint":""},
{"id":"","label":"Select activation function of hypernetwork","localized":"","hint":"Recommended : Swish / Linear(none)"},
{"id":"","label":"Select Layer weights initialization","localized":"","hint":"Recommended: Kaiming for relu-like, Xavier for sigmoid-like, Normal otherwise"},
@@ -342,8 +342,8 @@
{"id":"","label":"InvokeAI's","localized":"","hint":""},
{"id":"","label":"Sub-quadratic","localized":"","hint":""},
{"id":"","label":"Split attention","localized":"","hint":""},
- {"id":"","label":"xFormers enable flash Attention","localized":"","hint":""},
- {"id":"","label":"SDP disable memory attention","localized":"","hint":""},
+ {"id":"","label":"xFormers enable flash Attention","localized":"xFormers Flash Attention 활성화","hint":""},
+ {"id":"","label":"SDP disable memory attention","localized":"SDP Memory Attention 비활성화","hint":""},
{"id":"","label":"Sub-quadratic cross-attention query chunk size","localized":"Sub-quadratic 크로스 어텐션 쿼리 청크 크기","hint":""},
{"id":"","label":"Sub-quadratic cross-attention kv chunk size","localized":"Sub-quadratic 크로스 어텐션 kv 청크 크기","hint":""},
{"id":"","label":"Sub-quadratic cross-attention chunking threshold","localized":"Sub-quadratic 크로스 어텐션 청크 분할 임계값","hint":""},
@@ -363,16 +363,16 @@
{"id":"","label":"FP32","localized":"","hint":""},
{"id":"","label":"FP16","localized":"","hint":""},
{"id":"","label":"BF16","localized":"","hint":""},
- {"id":"","label":"Use full precision for model (--no-half)","localized":"모델에 단정밀도 사용 (--no-half)","hint":"Uses FP32 for the model. May produce better results while using more VRAM and slower generation"},
- {"id":"","label":"Use full precision for VAE (--no-half-vae)","localized":"VAE에 단정밀도 사용 (--no-half-vae)","hint":"Uses FP32 for the VAE. May produce better results while using more VRAM and slower generation"},
- {"id":"","label":"Enable upcast sampling","localized":"","hint":"Usually produces similar results to --no-half with better performance while using less memory"},
- {"id":"","label":"Enable upcast cross attention layer","localized":"","hint":""},
- {"id":"","label":"Disable NaN check in produced images/latent spaces","localized":"","hint":""},
- {"id":"","label":"Attempt VAE roll back when produced NaN values (experimental)","localized":"","hint":"Requires Torch 2.1 and NaN check enabled"},
- {"id":"","label":"Use channels last as torch memory format","localized":"","hint":""},
- {"id":"","label":"Enable full-depth cuDNN benchmark feature","localized":"","hint":""},
- {"id":"","label":"Allow TF32 math ops","localized":"TF32 단정밀도 연산 허용","hint":""},
- {"id":"","label":"Allow TF16 reduced precision math ops","localized":"TF16 반정밀도 연산 허용","hint":""},
+ {"id":"","label":"Use full precision for model (--no-half)","localized":"모델에 단정밀도 사용 (--no-half)","hint":"모델을 단정밀도 부동소수점(FP32)으로 불러온다. VRAM을 많이 사용하고 생성 속도가 느려지지만 더 좋은 결과물을 얻을 수도 있다."},
+ {"id":"","label":"Use full precision for VAE (--no-half-vae)","localized":"VAE에 단정밀도 사용 (--no-half-vae)","hint":"VAE를 단정밀도 부동소수점(FP32)으로 불러온다. VRAM을 많이 사용하고 생성 속도가 느려지지만 더 좋은 결과물을 얻을 수도 있다."},
+ {"id":"","label":"Enable upcast sampling","localized":"Upcast sampling 활성화","hint":"메모리를 덜 사용하고 좋은 성능을 내면서도 --no-half를 사용할 때와 비슷한 결과물을 얻을 수 있다."},
+ {"id":"","label":"Enable upcast cross attention layer","localized":"Upcast cross attention layer 활성화","hint":""},
+ {"id":"","label":"Disable NaN check in produced images/latent spaces","localized":"생성된 이미지와 잠재 공간(latent space)에 대해 NaN 검사를 하지 않음","hint":""},
+ {"id":"","label":"Attempt VAE roll back when produced NaN values (experimental)","localized":"NaN 값이 발견되었을 때 VAE 롤백 시도 (실험적)","hint":"Torch 2.1을 사용 중이고 NaN 검사가 활성화되어 있어야 한다."},
+ {"id":"","label":"Use channels last as torch memory format","localized":"Channels last 메모리 형식 사용","hint":""},
+ {"id":"","label":"Enable full-depth cuDNN benchmark feature","localized":"Full-depth cuDNN benchmark 기능 활성화","hint":""},
+ {"id":"","label":"Allow TF32 math ops","localized":"TF32 연산 허용","hint":""},
+ {"id":"","label":"Allow TF16 reduced precision math ops","localized":"TF16 연산 허용","hint":""},
{"id":"","label":"Enable model compile (experimental)","localized":"모델 컴파일 활성화 (실험적)","hint":""},
{"id":"","label":"inductor","localized":"","hint":""},
{"id":"","label":"cudagraphs","localized":"","hint":""},
@@ -381,7 +381,8 @@
{"id":"","label":"ipex","localized":"","hint":""},
{"id":"","label":"Model compile verbose mode","localized":"","hint":""},
{"id":"","label":"Model compile suppress errors","localized":"모델 컴파일 시 오류 억제","hint":""},
- {"id":"","label":"Disable Torch memory garbage collection","localized":"Torch 메모리 정리 비활성화","hint":"Disable Torch memory garbage collection on each generation. CG will still run before & after model load as well when low GPU memory threshold is reached."},
+ {"id":"","label":"Disable Torch memory garbage collection","localized":"Torch 메모리 정리 비활성화","hint":"이미지 생성 시 메모리 정리를 하지 않는다. CG will still run before & after model load as well when low GPU memory threshold is reached."},
+ {"id":"","label":"Enable IPEX Optimize for Intel GPUs","localized":"","hint":""},
{"id":"","label":"Directory for temporary images; leave empty for default","localized":"임시 이미지 저장 위치 (비워 놓으면 기본값)","hint":""},
{"id":"","label":"Cleanup non-default temporary directory when starting webui","localized":"임시 위치가 기본값이 아닌 경우 WebUI 시작 시 비우기","hint":""},
{"id":"","label":"Path to directory with stable diffusion checkpoints","localized":"체크포인트 위치","hint":""},
@@ -402,8 +403,8 @@
{"id":"","label":"Path to directory with LyCORIS network(s)","localized":"LyCORIS 위치","hint":""},
{"id":"","label":"Path to user-defined styles file","localized":"프롬프트 스타일 위치","hint":""},
{"id":"","label":"Always save all generated images","localized":"항상 생성된 모든 이미지 저장","hint":""},
- {"id":"","label":"File format for generated images","localized":"생성된 이미지의 파일 포맷","hint":"Select file format for images"},
- {"id":"","label":"Include metadata in saved images","localized":"저장된 이미지에 메타데이터 포함","hint":"Save image create parameters as metadata tags inside image file"},
+ {"id":"","label":"File format for generated images","localized":"생성된 이미지의 파일 형식","hint":"이미지 파일 형식을 선택한다."},
+ {"id":"","label":"Include metadata in saved images","localized":"저장된 이미지에 메타데이터 포함","hint":"이미지 파일에 이미지 생성 파라미터를 메타데이터로 저장한다."},
{"id":"","label":"Images filename pattern","localized":"이미지 파일명 패턴","hint":"Use following tags to define how filenames for images are chosen:
seq, uuid
date, datetime, job_timestamp
generation_number, batch_number
model, model_shortname
model_hash, model_name
sampler, seed, steps, cfg
clip_skip, denoising
hasprompt, prompt, styles
prompt_hash, prompt_no_styles
prompt_spaces, prompt_words
height, width, image_hash
"},
{"id":"","label":"Add number to filename when saving","localized":"저장 시 파일명에 숫자 추가","hint":""},
{"id":"","label":"Always save all generated image grids","localized":"항상 생성된 모든 그리드 이미지 저장","hint":""},
@@ -457,8 +458,8 @@
{"id":"","label":"Send seed when sending prompt or image to other interface","localized":"","hint":""},
{"id":"","label":"Send size when sending prompt or image to another interface","localized":"","hint":""},
{"id":"","label":"Font for image grids that have text","localized":"","hint":""},
- {"id":"","label":"Ctrl+up/down precision when editing (attention:1.1)","localized":"","hint":""},
- {"id":"","label":"Ctrl+up/down precision when editing ","localized":"","hint":""},
+ {"id":"","label":"Ctrl+up/down precision when editing (attention:1.1)","localized":"(attention:1.1) 수정 시 컨트롤+상/하 조절 정밀도","hint":""},
+ {"id":"","label":"Ctrl+up/down precision when editing ","localized":" 수정 시 컨트롤+상/하 조절 정밀도","hint":""},
{"id":"","label":"Ctrl+up/down word delimiters","localized":"","hint":""},
{"id":"","label":"Quicksettings list","localized":"빠른 설정 목록","hint":"List of setting names, separated by commas, for settings that should go to the quick access bar at the top instead the setting tab"},
{"id":"","label":"Hidden UI tabs","localized":"숨긴 UI 탭","hint":""},
@@ -517,10 +518,10 @@
{"id":"","label":"logSNR","localized":"","hint":""},
{"id":"","label":"UniPC order (must be < sampling steps)","localized":"","hint":""},
{"id":"","label":"UniPC lower order final","localized":"","hint":""},
- {"id":"","label":"Enable addtional postprocessing operations","localized":"","hint":""},
- {"id":"","label":"Postprocessing operation order","localized":"","hint":""},
+ {"id":"","label":"Enable addtional postprocessing operations","localized":"추가 후처리 작업","hint":""},
+ {"id":"","label":"Postprocessing operation order","localized":"후처리 작업 순서","hint":""},
{"id":"","label":"Maximum number of images in upscaling cache","localized":"","hint":""},
- {"id":"","label":"Move VAE and CLIP to RAM when training if possible","localized":"","hint":""},
+ {"id":"","label":"Move VAE and CLIP to RAM when training if possible","localized":"가능하다면 학습 시 VAE와 CLIP 모델을 램으로 이동","hint":""},
{"id":"","label":"Pin training dataset to memory","localized":"","hint":""},
{"id":"","label":"Save resumable optimizer state when training","localized":"","hint":""},
{"id":"","label":"Save training settings to a text file on training start","localized":"","hint":""},
@@ -565,9 +566,9 @@
{"id":"","label":"Select diffuser pipeline when loading from safetensors","localized":"safetensors 파일에서 로드할 때 사용할 파이프라인 선택","hint":""},
{"id":"","label":"Move base model to CPU when using refiner","localized":"리파이너를 사용 중일 때 base 모델을 CPU로 이동","hint":""},
{"id":"","label":"Move refiner model to CPU when not in use","localized":"사용 중이지 않을 때 리파이너 모델을 CPU로 이동","hint":""},
- {"id":"","label":"Move UNet to CPU while VAE decoding","localized":"","hint":""},
+ {"id":"","label":"Move UNet to CPU while VAE decoding","localized":"VAE 디코딩 시 UNet을 CPU로 이동","hint":""},
{"id":"","label":"Use model EMA weights when possible","localized":"가능하다면 모델의 EMA 가중치 사용","hint":""},
- {"id":"","label":"Generator device","localized":"Generator 디바이스","hint":""},
+ {"id":"","label":"Generator device","localized":"난수 생성 장치","hint":""},
{"id":"","label":"Enable sequential CPU offload","localized":"순차 CPU 오프로드 활성화","hint":"가중치를 CPU로 옮겨 GPU 메모리 사용률을 낮춘다. 속도가 약 10% 느려진다. Use with 어텐션 슬라이싱 활성화 for minimal memory consumption"},
{"id":"","label":"Enable model CPU offload","localized":"모델 CPU 오프로드 활성화","hint":"전체 모델을 GPU로 옮긴다. 여전히 GPU 메모리 사용률을 약간 낮춰주지만 생성 속도에는 무시할 수 있는 정도의 영향을 준다. 추가적인 메모리 절약을 위해서는 어텐션 슬라이싱과 함께 사용한다."},
{"id":"","label":"Enable VAE slicing","localized":"VAE 슬라이싱 활성화","hint":"Decodes batch latents one image at a time with limited VRAM. 여러 이미지를 다룰 때 VAE 해독 시 작은 성능 향상이 있다. 어텐션 슬라이싱과 함께 사용한다."},
diff --git a/installer.py b/installer.py
index cbb60c7fd..b1b5d1520 100644
--- a/installer.py
+++ b/installer.py
@@ -185,8 +185,6 @@ def install(package, friendly: str = None, ignore: bool = False):
if args.reinstall or args.upgrade:
global quick_allowed # pylint: disable=global-statement
quick_allowed = False
- if args.use_ipex and package == "pytorch_lightning==1.9.4":
- package = "pytorch_lightning==1.8.6"
if args.reinstall or not installed(package, friendly):
pip(f"install --upgrade {package}", ignore=ignore)
@@ -234,14 +232,18 @@ def branch(folder):
# update git repository
def update(folder, current_branch = False):
+ try:
+ git('config rebase.Autostash true')
+ except Exception:
+ pass
if current_branch:
- git('pull --autostash --rebase --force', folder)
+ git('pull --rebase --force', folder)
return
b = branch(folder)
if branch is None:
- git('pull --autostash --rebase --force', folder)
+ git('pull --rebase --force', folder)
else:
- git(f'pull origin {b} --autostash --rebase --force', folder)
+ git(f'pull origin {b} --rebase --force', folder)
# clone git repository
@@ -315,15 +317,18 @@ def check_torch():
os.environ.setdefault('TENSORFLOW_PACKAGE', 'tensorflow-rocm')
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.0.1 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/rocm5.4.2')
xformers_package = os.environ.get('XFORMERS_PACKAGE', 'none')
- elif allow_ipex and (args.use_ipex or shutil.which('sycl-ls') is not None or os.environ.get('ONEAPI_ROOT') is not None or os.path.exists('/opt/intel/oneapi')):
+ elif allow_ipex and (args.use_ipex or shutil.which('sycl-ls') is not None or shutil.which('sycl-ls.exe') is not None or os.environ.get('ONEAPI_ROOT') is not None or os.path.exists('/opt/intel/oneapi') or os.path.exists("C:/Program Files (x86)/Intel/oneAPI") or os.path.exists("C:/oneAPI")):
args.use_ipex = True # pylint: disable=attribute-defined-outside-init
log.info('Intel OneAPI Toolkit detected')
- if shutil.which('sycl-ls') is None:
- log.error('Intel OneAPI Toolkit is not activated! Start the WebUI with --use-ipex or activate OneAPI manually')
+ if shutil.which('sycl-ls') is None and shutil.which('sycl-ls.exe') is None:
+ log.error('Intel OneAPI Toolkit is not activated! Activate OneAPI manually!')
os.environ.setdefault('NEOReadDebugKeys', '1')
os.environ.setdefault('ClDeviceGlobalMemSizeAvailablePercent', '100')
- os.environ.setdefault('TENSORFLOW_PACKAGE', 'tensorflow==2.12.0 intel-extension-for-tensorflow[gpu]')
- torch_command = os.environ.get('TORCH_COMMAND', 'torch==1.13.0a0+git6c9b55e torchvision==0.14.1a0 intel_extension_for_pytorch==1.13.120+xpu -f https://developer.intel.com/ipex-whl-stable-xpu')
+ if "linux" in sys.platform:
+ torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.0.1a0 torchvision==0.15.2a0 intel_extension_for_pytorch==2.0.110+xpu -f https://developer.intel.com/ipex-whl-stable-xpu')
+ os.environ.setdefault('TENSORFLOW_PACKAGE', 'tensorflow==2.13.0 intel-extension-for-tensorflow[gpu]')
+ else:
+ torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.0.0a0 torchvision intel_extension_for_pytorch==2.0.110+gitba7f6c1 -f https://developer.intel.com/ipex-whl-stable-xpu')
else:
machine = platform.machine()
if sys.platform == 'darwin':
@@ -385,7 +390,7 @@ def check_torch():
pip('uninstall xformers --yes --quiet', ignore=True, quiet=True)
except Exception as e:
log.debug(f'Cannot install xformers package: {e}')
- if opts.get('cuda_compile_mode', '') == 'hidet':
+ if opts.get('cuda_compile_backend', '') == 'hidet':
install('hidet', 'hidet')
if args.profile:
print_profile(pr, 'Torch')
@@ -583,7 +588,7 @@ def install_requirements():
if args.profile:
pr = cProfile.Profile()
pr.enable()
- if args.skip_requirements:
+ if args.skip_requirements and not args.requirements:
return
log.info('Verifying requirements')
with open('requirements.txt', 'r', encoding='utf8') as f:
@@ -746,6 +751,7 @@ def add_args(parser):
group.add_argument('--debug', default = False, action='store_true', help = "Run installer with debug logging, default: %(default)s")
group.add_argument('--reset', default = False, action='store_true', help = "Reset main repository to latest version, default: %(default)s")
group.add_argument('--upgrade', default = False, action='store_true', help = "Upgrade main repository to latest version, default: %(default)s")
+ group.add_argument('--requirements', default = False, action='store_true', help = "Force re-check of requirements, default: %(default)s")
group.add_argument('--quick', default = False, action='store_true', help = "Run with startup sequence only, default: %(default)s")
group.add_argument("--use-ipex", default = False, action='store_true', help="Use Intel OneAPI XPU backend, default: %(default)s")
group.add_argument('--use-directml', default = False, action='store_true', help = "Use DirectML if no compatible GPU is detected, default: %(default)s")
diff --git a/modules/api/api.py b/modules/api/api.py
index c4bc4d49b..0a35a8fcf 100644
--- a/modules/api/api.py
+++ b/modules/api/api.py
@@ -9,10 +9,12 @@ from fastapi import FastAPI, APIRouter, Depends
from fastapi.security import HTTPBasic, HTTPBasicCredentials
from fastapi.exceptions import HTTPException
from PIL import PngImagePlugin,Image
+
import piexif
import piexif.helper
import gradio as gr
from modules import errors, shared, sd_samplers, deepbooru, sd_hijack, images, scripts, ui, postprocessing
+from modules.sd_vae import vae_dict
from modules.api import models
from modules.processing import StableDiffusionProcessingTxt2Img, StableDiffusionProcessingImg2Img, process_images
from modules.textual_inversion.textual_inversion import create_embedding, train_embedding
@@ -132,6 +134,7 @@ class Api:
self.add_api_route("/sdapi/v1/prompt-styles", self.get_prompt_styles, methods=["GET"], response_model=List[models.PromptStyleItem])
self.add_api_route("/sdapi/v1/embeddings", self.get_embeddings, methods=["GET"], response_model=models.EmbeddingsResponse)
self.add_api_route("/sdapi/v1/refresh-checkpoints", self.refresh_checkpoints, methods=["POST"])
+ self.add_api_route("/sdapi/v1/sd-vae", self.get_sd_vaes, methods=["GET"], response_model=List[models.SDVaeItem])
self.add_api_route("/sdapi/v1/refresh-vaes", self.refresh_vaes, methods=["POST"])
self.add_api_route("/sdapi/v1/create/embedding", self.create_embedding, methods=["POST"], response_model=models.CreateResponse)
self.add_api_route("/sdapi/v1/create/hypernetwork", self.create_hypernetwork, methods=["POST"], response_model=models.CreateResponse)
@@ -445,6 +448,10 @@ class Api:
def get_samplers(self):
return [{"name": sampler[0], "aliases":sampler[2], "options":sampler[3]} for sampler in sd_samplers.all_samplers]
+
+ def get_sd_vaes(self):
+ return [{"model_name": x, "filename": vae_dict[x]} for x in vae_dict.keys()]
+
def get_upscalers(self):
return [
diff --git a/modules/api/models.py b/modules/api/models.py
index 704ebfe92..a14d6d299 100644
--- a/modules/api/models.py
+++ b/modules/api/models.py
@@ -232,6 +232,10 @@ class SamplerItem(BaseModel):
aliases: List[str] = Field(title="Aliases")
options: Dict[str, str] = Field(title="Options")
+class SDVaeItem(BaseModel):
+ model_name: str = Field(title="Model Name")
+ filename: str = Field(title="Filename")
+
class UpscalerItem(BaseModel):
name: str = Field(title="Name")
model_name: Optional[str] = Field(title="Model Name")
diff --git a/modules/dml/backend.py b/modules/dml/backend.py
index ef46f288a..90b2d0528 100644
--- a/modules/dml/backend.py
+++ b/modules/dml/backend.py
@@ -7,10 +7,10 @@ import modules.dml.amp as amp
from .utils import rDevice, get_device
from .device import device
from .device_properties import DeviceProperties
-from .memory_amd import AMDMemoryProvider
from .memory import MemoryProvider
def amd_mem_get_info(device: Optional[rDevice]=None) -> tuple[int, int]:
+ from .memory_amd import AMDMemoryProvider
return AMDMemoryProvider.mem_get_info(get_device(device).index)
def pdh_mem_get_info(device: Optional[rDevice]=None) -> tuple[int, int]:
diff --git a/modules/ipex_specific/__init__.py b/modules/ipex_specific/__init__.py
index 042777928..b71027b35 100644
--- a/modules/ipex_specific/__init__.py
+++ b/modules/ipex_specific/__init__.py
@@ -1,4 +1,5 @@
import os
+import contextlib
import torch
import intel_extension_for_pytorch as ipex
from modules import shared
@@ -16,39 +17,77 @@ def ipex_no_cuda(orig_func, *args, **kwargs): # pylint: disable=redefined-outer-
orig_func(*args, **kwargs)
torch.cuda.is_available = torch.xpu.is_available
+def return_null_context(*args, **kwargs):
+ return contextlib.nullcontext()
+
def ipex_init():
- #Fix functions with ipex
- torch.cuda.is_available = torch.xpu.is_available
+ #Replace cuda with xpu:
+ torch.cuda.current_device = torch.xpu.current_device
+ torch.cuda.current_stream = torch.xpu.current_stream
torch.cuda.device = torch.xpu.device
torch.cuda.device_count = torch.xpu.device_count
- torch.cuda.current_device = torch.xpu.current_device
+ torch.cuda.device_of = torch.xpu.device_of
+ torch.cuda.getDeviceIdListForCard = torch.xpu.getDeviceIdListForCard
torch.cuda.get_device_name = torch.xpu.get_device_name
torch.cuda.get_device_properties = torch.xpu.get_device_properties
- torch._utils._get_available_device_type = lambda: "xpu" # pylint: disable=protected-access
+ torch.cuda.init = torch.xpu.init
+ torch.cuda.is_available = torch.xpu.is_available
+ torch.cuda.is_initialized = torch.xpu.is_initialized
torch.cuda.set_device = torch.xpu.set_device
+ torch.cuda.stream = torch.xpu.stream
torch.cuda.synchronize = torch.xpu.synchronize
+ torch.cuda.Event = torch.xpu.Event
+ torch.cuda.Stream = torch.xpu.Stream
+ torch.cuda.FloatTensor = torch.xpu.FloatTensor
torch.Tensor.cuda = torch.Tensor.xpu
- torch.nn.DataParallel = DummyDataParallel
+ torch.Tensor.is_cuda = torch.Tensor.is_xpu
#Memory:
- torch.xpu.empty_cache = torch.xpu.empty_cache if "WSL2" not in os.popen("uname -a").read() else lambda: None
torch.cuda.empty_cache = torch.xpu.empty_cache
- torch.cuda.ipc_collect = lambda: None
torch.cuda.memory_stats = torch.xpu.memory_stats
- torch.cuda.mem_get_info = lambda device=None: [(torch.xpu.get_device_properties(device).total_memory - torch.xpu.memory_allocated(device)), torch.xpu.get_device_properties(device).total_memory]
+ torch.cuda.memory_summary = torch.xpu.memory_summary
+ torch.cuda.memory_snapshot = torch.xpu.memory_snapshot
torch.cuda.memory_allocated = torch.xpu.memory_allocated
torch.cuda.max_memory_allocated = torch.xpu.max_memory_allocated
+ torch.cuda.memory_reserved = torch.xpu.memory_reserved
+ torch.cuda.max_memory_reserved = torch.xpu.max_memory_reserved
torch.cuda.reset_peak_memory_stats = torch.xpu.reset_peak_memory_stats
- torch.cuda.utilization = lambda: 0
+ torch.cuda.memory_stats_as_nested_dict = torch.xpu.memory_stats_as_nested_dict
+ torch.cuda.reset_accumulated_memory_stats = torch.xpu.reset_accumulated_memory_stats
+
+ #RNG:
+ torch.cuda.get_rng_state = torch.xpu.get_rng_state
+ torch.cuda.get_rng_state_all = torch.xpu.get_rng_state_all
+ torch.cuda.set_rng_state = torch.xpu.set_rng_state
+ torch.cuda.set_rng_state_all = torch.xpu.set_rng_state_all
+ torch.cuda.manual_seed = torch.xpu.manual_seed
+ torch.cuda.manual_seed_all = torch.xpu.manual_seed_all
+ torch.cuda.seed = torch.xpu.seed
+ torch.cuda.seed_all = torch.xpu.seed_all
+ torch.cuda.initial_seed = torch.xpu.initial_seed
#Training:
- torch.cuda.get_rng_state_all = torch.xpu.get_rng_state_all
- torch.cuda.set_rng_state_all = torch.xpu.set_rng_state_all
try:
torch.cuda.amp.GradScaler = torch.xpu.amp.GradScaler
except Exception:
torch.cuda.amp.GradScaler = ipex.cpu.autocast._grad_scaler.GradScaler
+ #C
+ torch._C._cuda_getCurrentRawStream = ipex._C._getCurrentStream
+ ipex._C._DeviceProperties.major = 2023
+ ipex._C._DeviceProperties.minor = 2
+
+ #Fix functions with ipex:
+ torch.cuda.mem_get_info = lambda device=None: [(torch.xpu.get_device_properties(device).total_memory - torch.xpu.memory_allocated(device)), torch.xpu.get_device_properties(device).total_memory]
+ torch._utils._get_available_device_type = lambda: "xpu" # pylint: disable=protected-access
+ torch.xpu.empty_cache = torch.xpu.empty_cache if "WSL2" not in os.popen("uname -a").read() else lambda: None
+ torch.cuda.get_device_properties.major = 2023
+ torch.cuda.get_device_properties.minor = 2
+ torch.backends.cuda.sdp_kernel = return_null_context
+ torch.nn.DataParallel = DummyDataParallel
+ torch.cuda.ipc_collect = lambda: None
+ torch.cuda.utilization = lambda: 0
+
#Libraries that blindly uses cuda:
#Adetailer:
CondFunc('torch.Tensor.to',
diff --git a/modules/sd_hijack.py b/modules/sd_hijack.py
index 362285f4a..a583d79d8 100644
--- a/modules/sd_hijack.py
+++ b/modules/sd_hijack.py
@@ -174,27 +174,31 @@ class StableDiffusionModelHijack:
if m.cond_stage_key == "edit":
sd_hijack_unet.hijack_ddpm_edit()
- if opts.cuda_compile and opts.cuda_compile_mode != 'none' and shared.backend == shared.Backend.ORIGINAL:
+ if opts.ipex_optimize and shared.backend == shared.Backend.ORIGINAL:
+ try:
+ import intel_extension_for_pytorch as ipex # pylint: disable=import-error, unused-import
+ m.model.training = False
+ m.model = ipex.optimize(m.model, dtype=devices.dtype_unet, inplace=True, weights_prepack=False) # pylint: disable=attribute-defined-outside-init
+ shared.log.info("Applied IPEX Optimize.")
+ except Exception as err:
+ shared.log.warning(f"IPEX Optimize not supported: {err}")
+
+ if opts.cuda_compile and opts.cuda_compile_backend != 'none' and shared.backend == shared.Backend.ORIGINAL:
try:
import logging
- shared.log.info(f"Compiling pipeline={m.model.__class__.__name__} mode={opts.cuda_compile_mode}")
- if opts.cuda_compile_mode == 'ipex':
- import intel_extension_for_pytorch as ipex # pylint: disable=import-error, unused-import
- m.model.training = False
- m.model = ipex.optimize(m.model, dtype=devices.dtype_unet, inplace=True, weights_prepack=False) # pylint: disable=attribute-defined-outside-init
- else:
- import torch._dynamo # pylint: disable=unused-import,redefined-outer-name
- log_level = logging.WARNING if opts.cuda_compile_verbose else logging.CRITICAL # pylint: disable=protected-access
- if hasattr(torch, '_logging'):
- torch._logging.set_logs(dynamo=log_level, aot=log_level, inductor=log_level) # pylint: disable=protected-access
- torch._dynamo.config.verbose = opts.cuda_compile_verbose # pylint: disable=protected-access
- torch._dynamo.config.suppress_errors = opts.cuda_compile_errors # pylint: disable=protected-access
- torch.backends.cudnn.benchmark = True
- if opts.cuda_compile_mode == 'hidet':
- import hidet
- hidet.torch.dynamo_config.use_tensor_core(True)
- hidet.torch.dynamo_config.search_space(2)
- m.model = torch.compile(m.model, mode="default", backend=opts.cuda_compile_mode, fullgraph=opts.cuda_compile_fullgraph, dynamic=False)
+ shared.log.info(f"Compiling pipeline={m.model.__class__.__name__} mode={opts.cuda_compile_backend}")
+ import torch._dynamo # pylint: disable=unused-import,redefined-outer-name
+ log_level = logging.WARNING if opts.cuda_compile_verbose else logging.CRITICAL # pylint: disable=protected-access
+ if hasattr(torch, '_logging'):
+ torch._logging.set_logs(dynamo=log_level, aot=log_level, inductor=log_level) # pylint: disable=protected-access
+ torch._dynamo.config.verbose = opts.cuda_compile_verbose # pylint: disable=protected-access
+ torch._dynamo.config.suppress_errors = opts.cuda_compile_errors # pylint: disable=protected-access
+ torch.backends.cudnn.benchmark = True
+ if opts.cuda_compile_backend == 'hidet':
+ import hidet
+ hidet.torch.dynamo_config.use_tensor_core(True)
+ hidet.torch.dynamo_config.search_space(2)
+ m.model = torch.compile(m.model, mode=opts.cuda_compile_mode, backend=opts.cuda_compile_backend, fullgraph=opts.cuda_compile_fullgraph, dynamic=False)
shared.log.info("Model complilation done.")
except Exception as err:
shared.log.warning(f"Model compile not supported: {err}")
diff --git a/modules/sd_models.py b/modules/sd_models.py
index 72dacf3bf..d010ffd6b 100644
--- a/modules/sd_models.py
+++ b/modules/sd_models.py
@@ -67,9 +67,11 @@ class CheckpointInfo:
else: # maybe a diffuser
repo = [r for r in modelloader.diffuser_repos if filename == r['filename']]
if len(repo) == 0:
- error_message = f'Cannot find diffuser model: {filename}'
- shared.log.error(error_message)
- raise ValueError(error_message)
+ if filename.lower() != 'none':
+ shared.log.error(f'Cannot find diffuser model: {filename}')
+ else:
+ shared.log.info(f'Skipping model load: {filename}')
+ return
self.name = repo[0]['name']
self.hash = repo[0]['hash'][:8]
self.sha256 = repo[0]['hash']
@@ -532,6 +534,8 @@ def change_backend():
def load_diffuser(checkpoint_info=None, already_loaded_state_dict=None, timer=None, op='model'): # pylint: disable=unused-argument
+ if op != 'model' and checkpoint_info is None and (shared.cmd_opts.ckpt is None or shared.cmd_opts.ckpt.lower() == 'none'):
+ return
import torch # pylint: disable=reimported,redefined-outer-name
devices.set_cuda_params()
if timer is None:
@@ -570,7 +574,7 @@ def load_diffuser(checkpoint_info=None, already_loaded_state_dict=None, timer=No
sd_model = None
try:
- if shared.cmd_opts.ckpt is not None and model_data.initial: # initial load
+ if shared.cmd_opts.ckpt is not None and model_data.initial: # initial load\
ckpt_basename = os.path.basename(shared.cmd_opts.ckpt)
model_name = modelloader.find_diffuser(ckpt_basename)
if model_name is not None:
@@ -655,6 +659,12 @@ def load_diffuser(checkpoint_info=None, already_loaded_state_dict=None, timer=No
elif "Kandinsky" in sd_model.__class__.__name__:
sd_model.scheduler.name = 'DDIM'
+ if (shared.opts.diffusers_model_cpu_offload or shared.cmd_opts.medvram) and (shared.opts.diffusers_seq_cpu_offload or shared.cmd_opts.lowvram):
+ shared.log.warning(f'Diffusers {op}: Model CPU offload (--medvram) and Sequential CPU offload (--lowvram) are not compatible')
+ shared.log.debug(f'Diffusers {op}: disable model CPU offload and --medvram')
+ shared.opts.diffusers_model_cpu_offload=False
+ shared.cmd_opts.medvram=False
+
if hasattr(sd_model, "watermark"):
sd_model.watermark = NoWatermark()
sd_model.has_accelerate = False
@@ -702,7 +712,7 @@ def load_diffuser(checkpoint_info=None, already_loaded_state_dict=None, timer=No
sd_model.unet.to(memory_format=torch.channels_last)
base_sent_to_cpu=False
- if shared.opts.cuda_compile and torch.cuda.is_available():
+ if (shared.opts.cuda_compile or shared.opts.ipex_optimize) and torch.cuda.is_available():
if op == 'refiner' and not sd_model.has_accelerate:
gpu_vram = memory_stats().get('gpu', {})
free_vram = gpu_vram.get('total', 0) - gpu_vram.get('used', 0)
@@ -725,20 +735,24 @@ def load_diffuser(checkpoint_info=None, already_loaded_state_dict=None, timer=No
elif not sd_model.has_accelerate:
sd_model.to(devices.device)
try:
- shared.log.info(f"Compiling pipeline={sd_model.__class__.__name__} shape={8 * sd_model.unet.config.sample_size} mode={shared.opts.cuda_compile_mode}")
- if shared.opts.cuda_compile_mode == 'ipex':
+ if shared.opts.ipex_optimize:
sd_model.unet.training = False
sd_model.unet = torch.xpu.optimize(sd_model.unet, dtype=devices.dtype_unet, inplace=True, weights_prepack=False) # pylint: disable=attribute-defined-outside-init
- else:
+ shared.log.info("Applied IPEX Optimize.")
+ except Exception as err:
+ shared.log.warning(f"IPEX Optimize not supported: {err}")
+ try:
+ if shared.opts.cuda_compile:
+ shared.log.info(f"Compiling pipeline={sd_model.__class__.__name__} shape={8 * sd_model.unet.config.sample_size} mode={shared.opts.cuda_compile_backend}")
import torch._dynamo # pylint: disable=unused-import,redefined-outer-name
log_level = logging.WARNING if shared.opts.cuda_compile_verbose else logging.CRITICAL # pylint: disable=protected-access
if hasattr(torch, '_logging'):
torch._logging.set_logs(dynamo=log_level, aot=log_level, inductor=log_level) # pylint: disable=protected-access
torch._dynamo.config.verbose = shared.opts.cuda_compile_verbose # pylint: disable=protected-access
torch._dynamo.config.suppress_errors = shared.opts.cuda_compile_errors # pylint: disable=protected-access
- sd_model.unet = torch.compile(sd_model.unet, mode=shared.opts.cuda_compile_mode, fullgraph=shared.opts.cuda_compile_fullgraph) # pylint: disable=attribute-defined-outside-init
+ sd_model.unet = torch.compile(sd_model.unet, mode=shared.opts.cuda_compile_mode, backend=shared.opts.cuda_compile_backend, fullgraph=shared.opts.cuda_compile_fullgraph) # pylint: disable=attribute-defined-outside-init
sd_model("dummy prompt")
- shared.log.info("Complilation done.")
+ shared.log.info("Complilation done.")
except Exception as err:
shared.log.warning(f"Model compile not supported: {err}")
diff --git a/modules/shared.py b/modules/shared.py
index 6c888819c..3a3ce09f3 100644
--- a/modules/shared.py
+++ b/modules/shared.py
@@ -385,11 +385,13 @@ options_templates.update(options_section(('cuda', "Compute Settings"), {
"cuda_allow_tf32": OptionInfo(True, "Allow TF32 math ops"),
"cuda_allow_tf16_reduced": OptionInfo(True, "Allow TF16 reduced precision math ops"),
"cuda_compile": OptionInfo(False, "Enable model compile (experimental)"),
- "cuda_compile_mode": OptionInfo("none", "Model compile mode (experimental)", gr.Radio, lambda: {"choices": ['none', 'inductor', 'reduce-overhead', 'cudagraphs', 'aot_ts_nvfuser', 'hidet', 'ipex']}),
+ "cuda_compile_backend": OptionInfo("none", "Model compile backend (experimental)", gr.Radio, lambda: {"choices": ['none', 'inductor', 'cudagraphs', 'aot_ts_nvfuser', 'hidet', 'ipex']}),
+ "cuda_compile_mode": OptionInfo("default", "Model compile mode (experimental)", gr.Radio, lambda: {"choices": ['default', 'reduce-overhead', 'max-autotune']}),
"cuda_compile_fullgraph": OptionInfo(False, "Model compile fullgraph"),
"cuda_compile_verbose": OptionInfo(False, "Model compile verbose mode"),
"cuda_compile_errors": OptionInfo(True, "Model compile suppress errors"),
"disable_gc": OptionInfo(True, "Disable Torch memory garbage collection"),
+ "ipex_optimize": OptionInfo(True if devices.backend == "ipex" else False, "Enable IPEX Optimize for Intel GPUs"),
"directml_memory_provider": OptionInfo(default_memory_provider, '[DirectML] Memory stats provider', gr.Dropdown, lambda: {"choices": memory_providers}),
}))
diff --git a/modules/ui.py b/modules/ui.py
index 179c68a26..7ca1261ca 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -32,6 +32,7 @@ import modules.sd_samplers
modules.errors.install()
mimetypes.init()
mimetypes.add_type('application/javascript', '.js')
+log = modules.shared.log
if not cmd_opts.share and not cmd_opts.listen:
# fix gradio phoning home
@@ -126,7 +127,7 @@ def process_interrogate(interrogation_function, mode, ii_input_files, ii_input_d
images = [f.name for f in ii_input_files]
else:
if not os.path.isdir(ii_input_dir):
- modules.shared.log.error(f"Input directory not found: {ii_input_dir}")
+ log.error(f"Input directory not found: {ii_input_dir}")
return
images = modules.shared.listfiles(ii_input_dir)
if ii_output_dir != "":
@@ -195,7 +196,7 @@ def connect_reuse_seed(seed: gr.Number, reuse_seed: gr.Button, generation_info:
res = all_seeds[index if 0 <= index < len(all_seeds) else 0]
except json.decoder.JSONDecodeError:
if gen_info_string != '':
- modules.shared.log.error(f"Error parsing JSON generation info: {gen_info_string}")
+ log.error(f"Error parsing JSON generation info: {gen_info_string}")
return [res, gr_show(False)]
reuse_seed.click(fn=copy_seed, _js="(x, y) => [x, selected_gallery_index()]", show_progress=False, inputs=[generation_info, dummy_component], outputs=[seed, dummy_component])
@@ -503,6 +504,7 @@ def create_ui(startup_timer = None):
negative_token_button.click(fn=wrap_queued_call(update_token_counter), inputs=[txt2img_negative_prompt, steps], outputs=[negative_token_counter])
ui_extra_networks.setup_ui(extra_networks_ui, txt2img_gallery)
+ log.debug(f'UI interface: tab=txt2img batch={show_batch.value} seed={show_seed.value} advanced={show_advanced.value} second_pass={show_second_pass.value}')
startup_timer.record("ui-txt2img")
@@ -854,6 +856,8 @@ def create_ui(startup_timer = None):
paste_button=img2img_paste, tabname="img2img", source_text_component=img2img_prompt, source_image_component=None,
))
+ log.debug(f'UI interface: tab=img2img seed={show_seed.value} resize={show_resize.value} batch={show_batch.value} denoise={show_denoise.value} advanced={show_advanced.value}')
+
startup_timer.record("ui-img2img")
modules.scripts.scripts_current = None
@@ -910,7 +914,7 @@ def create_ui(startup_timer = None):
try:
res = comp(label=info.label, value=fun(), elem_id=elem_id, **(args or {}))
except Exception as e:
- modules.shared.log.error(f'Error creating setting: {key} {e}')
+ log.error(f'Error creating setting: {key} {e}')
res = None
if res is not None and not is_quicksettings:
@@ -955,9 +959,9 @@ def create_ui(startup_timer = None):
directml_override_opts()
try:
opts.save(modules.shared.config_filename)
- modules.shared.log.info(f'Settings changed: {len(changed)} {changed}')
+ log.info(f'Settings changed: {len(changed)} {changed}')
except RuntimeError:
- modules.shared.log.error(f'Settings change failed: {len(changed)} {changed}')
+ log.error(f'Settings change failed: {len(changed)} {changed}')
return opts.dumpjson(), f'{len(changed)} Settings changed without save: {", ".join(changed)}'
return opts.dumpjson(), f'{len(changed)} Settings changed{": " if len(changed) > 0 else ""}{", ".join(changed)}'
@@ -969,7 +973,7 @@ def create_ui(startup_timer = None):
if cmd_opts.use_directml:
directml_override_opts()
opts.save(modules.shared.config_filename)
- modules.shared.log.debug(f'Setting changed: key={key}, value={value}')
+ log.debug(f'Setting changed: key={key}, value={value}')
return get_value_for_setting(key), opts.dumpjson()
with gr.Blocks(analytics_enabled=False) as settings_interface:
@@ -1179,7 +1183,7 @@ def html_head():
head += f'\n'
added.append(script.path)
added = [a.replace(script_path, '').replace('\\', '/') for a in added]
- # modules.shared.log.debug(f'Adding JS scripts: {added}')
+ # log.debug(f'Adding JS scripts: {added}')
return head
@@ -1209,7 +1213,7 @@ def html_css():
if os.path.exists(os.path.join(data_path, "user.css")):
head += stylesheet(os.path.join(data_path, "user.css"))
added = [a.replace(script_path, '').replace('\\', '/') for a in added]
- # modules.shared.log.debug(f'Adding CSS stylesheets: {added}')
+ # log.debug(f'Adding CSS stylesheets: {added}')
return head
diff --git a/modules/ui_models.py b/modules/ui_models.py
index d1afb8183..54b24bfea 100644
--- a/modules/ui_models.py
+++ b/modules/ui_models.py
@@ -141,12 +141,22 @@ def create_ui():
model_checkhash_btn = gr.Button(value="Calculate hash for all models (may take a long time)", variant='primary')
model_checkhash_btn.click(fn=sd_models.update_model_hashes, inputs=[], outputs=[models_outcome])
with gr.Row():
- model_table = gr.DataFrame(model_data, label = 'Model data', show_label = True, interactive = False, wrap = True, overflow_row_behaviour = 'paginate', max_rows = 10, headers = model_headers)
+ model_table = gr.DataFrame(
+ value = model_data,
+ headers = model_headers,
+ label = 'Model data',
+ show_label = True,
+ interactive = False,
+ wrap = True,
+ overflow_row_behaviour = 'paginate',
+ max_rows = 50,
+ )
def list_models():
total_size = 0
+ model_data.clear()
+ txt = ''
for m in sd_models.checkpoints_list.values():
- txt = ''
try:
stat = os.stat(m.filename)
m_name = m.name.replace('.ckpt', '').replace('.safetensors', '')
diff --git a/requirements.txt b/requirements.txt
index 79d52cb80..e3ab89323 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -24,7 +24,7 @@ lmdb
lpips
omegaconf
open-clip-torch
-opencv-contrib-python
+opencv-contrib-python-headless
piexif
psutil
pyyaml
@@ -48,7 +48,7 @@ antlr4-python3-runtime==4.9.3
requests==2.31.0
tqdm==4.65.0
accelerate==0.20.3
-opencv-python==4.7.0.72
+opencv-python-headless==4.7.0.72
diffusers==0.19.3
einops==0.4.1
gradio==3.32.0
diff --git a/webui.sh b/webui.sh
index dee18931f..550008f2d 100755
--- a/webui.sh
+++ b/webui.sh
@@ -96,7 +96,7 @@ if [[ ! -z "${ACCELERATE}" ]] && [ ${ACCELERATE}="True" ] && [ -x "$(command -v
then
echo "Launching accelerate launch.py..."
exec accelerate launch --num_cpu_threads_per_process=6 launch.py "$@"
-elif [[ -z "${first_launch}" ]] && [ -x "$(command -v ipexrun)" ] && [ -x "$(command -v numactl)" ] && [ -x "$(command -v sycl-ls)" ]
+elif [[ -z "${first_launch}" ]] && [[ $(uname -a) != *WSL2* ]] && [ -x "$(command -v ipexrun)" ] && [ -x "$(command -v numactl)" ] && [ -x "$(command -v sycl-ls)" ]
then
echo "Launching ipexrun launch.py..."
exec ipexrun launch.py "$@"