Merge branch 'dev'

This commit is contained in:
Dowon
2024-04-17 19:57:43 +09:00
8 changed files with 43 additions and 36 deletions

View File

@@ -1,10 +0,0 @@
name: Question
description: Write a question
labels:
- question
body:
- type: textarea
attributes:
label: Question
description: Please do not write bug reports or feature requests here.

22
.github/workflows/lint.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: Empirical Implementation of JDD
on:
pull_request:
types:
- opened
jobs:
lint:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
![Imgur](https://i.imgur.com/ESow3BL.png)
LGTM
reactions: hooray

View File

@@ -1,19 +0,0 @@
name: Not Lint
on:
pull_request:
types:
- opened
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/auto-comment@v1
with:
GITHUB_TOKEN: ${{ github.token }}
pullRequestOpened: |
![Imgur](https://i.imgur.com/ESow3BL.png)
LGTM

View File

@@ -10,6 +10,7 @@ repos:
- id: check-merge-conflict
- id: check-case-conflict
- id: check-ast
- id: check-yaml
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer

View File

@@ -1,5 +1,11 @@
# Changelog
## 2024-04-17
- v24.4.2
- `params.txt` 파일이 없을 때 에러가 발생하지 않도록 수정
- 파이썬 3.9 이하에서 유니온 타입 에러 방지
## 2024-04-14
- v24.4.1

View File

@@ -2,7 +2,7 @@ from __future__ import annotations
from contextlib import contextmanager
from copy import copy
from typing import TYPE_CHECKING, Any
from typing import TYPE_CHECKING, Any, Union
import torch
@@ -21,7 +21,7 @@ else:
StableDiffusionProcessingTxt2Img,
)
PT = StableDiffusionProcessingTxt2Img | StableDiffusionProcessingImg2Img
PT = Union[StableDiffusionProcessingTxt2Img, StableDiffusionProcessingImg2Img]
@contextmanager

View File

@@ -1 +1 @@
__version__ = "24.4.1"
__version__ = "24.4.2"

View File

@@ -4,7 +4,6 @@ import platform
import re
import sys
import traceback
from contextlib import suppress
from copy import copy
from functools import partial
from pathlib import Path
@@ -71,6 +70,8 @@ from modules.shared import cmd_opts, opts, state
if TYPE_CHECKING:
from fastapi import FastAPI
PARAMS_TXT = "params.txt"
no_huggingface = getattr(cmd_opts, "ad_no_huggingface", False)
adetailer_dir = Path(paths.models_path, "adetailer")
safe_mkdir(adetailer_dir)
@@ -409,9 +410,15 @@ class AfterDetailerScript(scripts.Script):
p, p.all_prompts, p.all_seeds, p.all_subseeds, None, 0, 0
)
def read_params_txt(self) -> str:
params_txt = Path(paths.data_path, PARAMS_TXT)
if params_txt.exists():
return params_txt.read_text(encoding="utf-8")
return ""
def write_params_txt(self, content: str) -> None:
params_txt = Path(paths.data_path, "params.txt")
with suppress(Exception):
params_txt = Path(paths.data_path, PARAMS_TXT)
if params_txt.exists() and content:
params_txt.write_text(content, encoding="utf-8")
@staticmethod
@@ -783,7 +790,7 @@ class AfterDetailerScript(scripts.Script):
pp.image = ensure_pil_image(pp.image, "RGB")
init_image = copy(pp.image)
arg_list = self.get_args(p, *args_)
params_txt_content = Path(paths.data_path, "params.txt").read_text("utf-8")
params_txt_content = self.read_params_txt()
if need_call_postprocess(p):
dummy = Processed(p, [], p.seed, "")