Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Bing-su committed Apr 17, 2024
2 parents 94bab91 + 7fe4301 commit 1edd588
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 36 deletions.
10 changes: 0 additions & 10 deletions .github/ISSUE_TEMPLATE/question.yaml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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
19 changes: 0 additions & 19 deletions .github/workflows/notlint.yml

This file was deleted.

1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2024-04-17

- v24.4.2
- `params.txt` 파일이 없을 때 에러가 발생하지 않도록 수정
- 파이썬 3.9 이하에서 유니온 타입 에러 방지

## 2024-04-14

- v24.4.1
Expand Down
4 changes: 2 additions & 2 deletions aaaaaa/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from contextlib import contextmanager
from copy import copy
from typing import TYPE_CHECKING, Any
from typing import TYPE_CHECKING, Any, Union

import torch

Expand All @@ -21,7 +21,7 @@
StableDiffusionProcessingTxt2Img,
)

PT = StableDiffusionProcessingTxt2Img | StableDiffusionProcessingImg2Img
PT = Union[StableDiffusionProcessingTxt2Img, StableDiffusionProcessingImg2Img]


@contextmanager
Expand Down
2 changes: 1 addition & 1 deletion adetailer/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "24.4.1"
__version__ = "24.4.2"
15 changes: 11 additions & 4 deletions scripts/!adetailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import re
import sys
import traceback
from contextlib import suppress
from copy import copy
from functools import partial
from pathlib import Path
Expand Down Expand Up @@ -71,6 +70,8 @@
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)
Expand Down Expand Up @@ -409,9 +410,15 @@ def infotext(p) -> str:
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
Expand Down Expand Up @@ -783,7 +790,7 @@ def postprocess_image(self, p, pp, *args_):
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, "")
Expand Down

0 comments on commit 1edd588

Please sign in to comment.