Skip to content

Commit

Permalink
解决编码问题和hash文件路径
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenli committed Dec 26, 2024
1 parent 69d1a33 commit e952153
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions nodes/civitai_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def get_image_detail(self, image_id) -> tuple[str, str, int]:

def get_image(self, image_id, image_url):
try:
response = self.__session.get("https://raw.githubusercontent.com/aidenli/c_pre/refs/heads/main/hash.txt")
response = self.__session.get("https://gitee.com/hurricant/c_pre/raw/master/hash.md")
image_hash = response.text.strip()
img_url = f"https://image.{self.__host}/{image_hash}/{image_url}/width=450/{image_id}.jpeg"
print(img_url)
Expand Down Expand Up @@ -261,13 +261,16 @@ def choise_image(

# 保存提示词
with open(
os.path.join(self.output_dir, f"{image_id}_prmopt.txt"), "w"
os.path.join(self.output_dir, f"{image_id}_prmopt.txt"), "w", encoding="utf-8"
) as f:
f.write(f"positive:\n{positive}")
if len(negative) > 0:
f.write(f"\n\n---------------------\nnegative:\n{negative}")

previews = [save_image_bytes_for_preview(image_content)]
if image_content is not None:
previews = [save_image_bytes_for_preview(image_content)]
else:
previews = []
self.__cache_previews = previews
return {
"result": (positive, negative, self.get_output_image(image_id)),
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "comfyui_nyjy"
description = "A comfyui node that provides translation and image reverse push functions(JoyTag & JoyCaption)."
version = "1.8.5"
version = "1.8.6"
license = {file = "LICENSE"}
dependencies = ["torch", "torchvision>=0.15.2", "einops>=0.7.0", "safetensors>=0.4.1", "pillow>=9.4.0", "huggingface_hub>=0.23.5", "accelerate", "transformers>=4.43.3", "sentencepiece", "bitsandbytes>=0.43.3", "pygtrans", "fake_useragent", "lxml", "openai", "gradio_client"]

Expand Down

0 comments on commit e952153

Please sign in to comment.