Skip to content

Commit

Permalink
for Ruff check and Super-linter
Browse files Browse the repository at this point in the history
  • Loading branch information
QunBB committed Sep 9, 2024
1 parent 9b4415d commit 132fe4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
import os
import random
import uuid
import websocket
from copy import deepcopy
from typing import Any, Union

import websocket
from httpx import get, post
from yarl import URL

from core.tools.entities.common_entities import I18nObject
from core.tools.entities.tool_entities import ToolInvokeMessage, ToolParameter, ToolParameterOption
from core.tools.errors import ToolProviderCredentialValidationError
from core.tools.tool.builtin_tool import BuiltinTool
from httpx import get, post
from yarl import URL

SD_TXT2IMG_OPTIONS = {}
LORA_NODE = {
Expand Down Expand Up @@ -257,7 +258,7 @@ def text2img(self, base_url: str, model: str, prompt: str, negative_prompt: str,
"""
if not SD_TXT2IMG_OPTIONS:
current_dir = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(current_dir, 'txt2img.json'), 'r') as file:
with open(os.path.join(current_dir, 'txt2img.json')) as file:
SD_TXT2IMG_OPTIONS.update(json.load(file))

draw_options = deepcopy(SD_TXT2IMG_OPTIONS)
Expand Down Expand Up @@ -298,7 +299,7 @@ def text2img(self, base_url: str, model: str, prompt: str, negative_prompt: str,
result = self.queue_prompt_image(base_url, client_id, prompt=draw_options)

# get first image
image = bytes()
image = b""
for node in result:
for img in result[node]:
if img:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,4 @@ parameters:
en_US: Lora Strength 3
zh_Hans: Lora模型的权重
pt_BR: Lora Strength 3
form: form
form: form

0 comments on commit 132fe4c

Please sign in to comment.