That's what I have and it's not working "if \_\_name\_\_ == '\_\_main\_\_':
 if len(sys.argv) > 1:
 url = STASH\_URL
 key = API\_KEY
 if len(sys.argv) > 2:
 url = sys.argv[2]

 if sys.argv[1] == "setup":
 client = UpscaleWith(url, key)
 client.setup\_tags()
 elif sys.argv[1] == "upscale\_all":
 client = UpscaleWith(url, key)
 client.upscale\_PerformerImage()
 elif sys.argv[1] == "remove\_tags":
 client = UpscaleWith(url, key)
 client.remove\_tags()
 elif sys.argv[1] == "api":
 fragment = json.loads(sys.stdin.read())
 scheme = fragment["server\_connection"]["Scheme"]
 port = fragment["server\_connection"]["Port"]
 domain = "localhost"
 if "Domain" in fragment["server\_connection"]:
 domain = fragment["server\_connection"]["Domain"]
 if not domain:
 domain = 'localhost'
 url = scheme + "://" + domain + ":" + str(port) + "/graphql"

 client = UpscaleWith(url, key)
 mode = fragment["args"]["mode"]
 client.debug("Mode: "+mode)
 if mode == "setup":
 client.setup\_tags()
 elif mode == "upscale\_all":
 client.upscale\_PerformerImage()
 elif mode == "remove\_tags":
 client.remove\_tags()
 else:
 print("")
" and this at the top of the file "class UpscaleWith:
 """
 Main plugin class
 """
 def \_\_init\_\_(self, STASH\_URL, API\_KEY):
 self.url = STASH\_URL
 self.API\_KEY = API\_KEY

 def \_\_prefix(self, levelchar):
 startlevelchar = b'\x01'
 endlevelchar = b'\x02'

 ret = startlevelchar + levelchar + endlevelchar
 return ret.decode()

 def \_\_log(self, levelchar, error\_code):
 if levelchar == "":
 return
 if error\_code == "":
 return

 print(self.\_\_prefix(levelchar) + error\_code + "\n", file=sys.stderr, flush=True)

 def trace(self, error\_code):
 self.\_\_log(b't', error\_code)

 def debug(self, error\_code):
 self.\_\_log(b'd', error\_code)

 def info(self, error\_code):
 self.\_\_log(b'i', error\_code)

 def warning(self, error\_code):
 self.\_\_log(b'w', error\_code)

 def error(self, error\_code):
 self.\_\_log(b'e', error\_code)

 def progress(self, p):
 progress = min(max(0, p), 1)
 self.\_\_log(b'p', str(progress))

 def \_\_callGraphQL(self, query, variables=None):
 self.headers = {
 "Accept-Encoding": "gzip, deflate, br",
 "Content-Type": "application/json",
 "Accept": "application/json",
 "Connection": "keep-alive",
 "DNT": "1",
 "apiKey": self.API\_KEY
 }
 json = {}
 json['query'] = query
 if variables != None:
 json['variables'] = variables

 # handle cookies
 response = requests.post(self.url, json=json, headers=self.headers)

 if response.status\_code == 200:
 result = response.json()
 if result.get("error", None):
 for error in result["error"]["errors"]:
 raise Exception("GraphQL error: {}".format(error))
 if result.get("data", None):
 return result.get("data")
 elif response.status\_code == 401:
 self.error(
 "[ERROR][GraphQL] HTTP Error 401, Unauthorised. You can add a API Key in at top of the script")
 return None
 else:
 raise Exception(
 "GraphQL query failed:{} - {}. Query: {}. Variables: {}".format(response.status\_code, response.content,
 query, variables))". Could it be because before I have the Class of upscalewith, I have this class "class MainGigapixel(Gigapixel):
 """
Gigapixel Sub Class to overide Gigapixel imported module class and add 
functionality to clear processed images.
As plugin will not work if there is any processed images in queue.
"""
 def \_\_log(self, levelchar, error\_code):
 if levelchar == "":
 return
 if error\_code == "":
 return

 def error(self, error\_code):
 """
 Handles error logging
 """
 self.\_\_log(b'e', error\_code)

 def start\_gigapixel(self):
 """
 Function to start Gigapixel
 """
 app = MainGigapixel(EXE\_PATH, OUTPUT\_SUFFIX)
 if app is None:
 self.error("Cannot Start Gigapixel, check path variable & try again")

 def start\_gigapixel\_thread(self):
 """
 Function to initialise start\_gigapixel threaded
 """
 thread = threading.Thread(target=self.start\_gigapixel)
 thread.start()
 thread.join()

 def send\_keys\_clear(self):
 """
 Function to send keys to Gigapixel to clear photos
 """
 send\_keys("^{W}")

 def process(self, photo\_path: Path, scale: Scale = Scale.X2, mode: Mode = Mode.STANDARD) -> Path:
 self.\_check\_path(photo\_path)
 self.send\_keys\_clear()
 self.\_app.open\_photo(photo\_path)
 self.\_app.set\_processing\_options(scale, mode)
 self.\_app.save\_photo()
 self.send\_keys\_clear()

 return self.\_get\_save\_path(photo\_path)" which is called in a function within the upscalewith class.
그게 내가 가지고있는 것이고 작동하지 않습니다."if \_\_name\_\_ == '\_\_main\_\_':
 if len(sys.argv) > 1:
 url = STASH\_URL
 key = API\_KEY
 len(sys.argv) > 2:
 url = sys.argv[2]

 sys.argv[1] == "setup":
 client = UpscaleWith(url, key)
 client.setup\_tags()
 elif sys.argv[1] == "upscale\_all":
 client = UpscaleWith(url, key)
 client.upscale\_퍼포머이미지()
 elif sys.argv[1] == "remove\_tags":
 client = UpscaleWith(url, key)
 client.remove\_tags()
 elif sys.argv[1] == "api":
 fragment = json.loads(sys.stdin.read())
 scheme = fragment["server\_connection"]["Scheme"]
 port = fragment["server\_connection"]["Port"]
 domain = "localhost"
 fragment["서버\_연결"]에 "도메인"이 있으면
 domain = fragment["서버\_연결"]["도메인"]
 도메인이 아닌 경우
 domain = 'localhost'
 url = scheme + "://" + domain + ":" + str(port) + "/graphql"

 client = UpscaleWith(url, key)
 mode = fragment["args"]["mode"]
 client.debug("모드:"+모드)
 mode == "setup":
 client.setup\_tags()
 elif mode == "upscale\_all":
 client.upscale\_퍼포머이미지()
 elif mode == "remove\_tags":
 client.remove\_tags()
 else:
 print("")
"그리고 이것은 파일 상단의 "클래스 UpscaleWith:
 """
 메인 플러그인 클래스
 """
 def \_\_init\_\_(self, STASH\_URL, API\_KEY):
 self.url = STASH\_URL
 self.API\_KEY = API\_KEY

 def \_\_prefix(self, levelchar):
 startlevelchar = b'\x01'
 endlevelchar = b'\x02'

 ret = startlevelchar + levelchar + endlevelchar
 반환 ret.decode()

 def \_\_log(self, levelchar, error\_code):
 if levelchar == "":
 return
 if error\_code == "":
 return

 print(self.\_\_prefix(levelchar) + error\_code + "\n", file=sys.stderr, flush=True)

 def trace(self, error\_code):
 self.\_\_log(b't', error\_code)

 def debug(self, error\_code):
 self.\_\_log(b'd', error\_code)

 def info(self, error\_code):
 self.\_\_log(b'i', error\_code)

 def warning(self, error\_code):
 self.\_\_log(b'w', error\_code)

 def error(self, error\_code):
 self.\_\_log(b'e', error\_code)

 def progress(self, p):
 progress = min(max(0, p), 1)
 self.\_\_log(b'p', str(progress))

 def \_\_callGraphQL(self, query, variables=None):
 self.headers = {
 "Accept-Encoding": "GZIP, DEFLATE, BR",
 "Content-Type": "application/json",
 "Accept": "application/json",
 "연결": "keep-alive",
 "DNT": "1",
 "apiKey": self.API\_KEY
 }
 json = {}
 json['쿼리'] = 쿼리
 variables != None:
 json['variables'] = variables

 # 쿠키 처리
 response = requests.post(self.url, json=json, headers=self.headers)

 response.status\_code == 200이면
 result = response.json()
 if result.get("error", None):
 result["error"]["errors"]의 오류에 대해:
 raise Exception("GraphQL 오류입니다: {}".format(error))
 if result.get("data", None):
 return result.get("data")
 elif response.status\_code == 401:
 self.error(
 "[ERROR][GraphQL] HTTP 오류 401, 권한 없음. 스크립트 상단에 API 키를 추가할 수 있습니다.")
 반환 없음
 else:
 예외 발생(
 "GraphQL 쿼리 실패:{} - {}. Query: {}. 변수: {}".format(response.status\_code, response.content,
 쿼리, 변수))". 업스케일 위드 클래스가 있기 전에 "class MainGigapixel(Gigapixel):
 """
기가픽셀 서브 클래스를 사용하여 기가픽셀 가져온 모듈 클래스를 무시하고 
기능을 추가합니다.
대기열에 처리된 이미지가 있으면 플러그인이 작동하지 않으므로 주의하세요.
"""
 def \_\_log(self, levelchar, error\_code):
 if levelchar == "":
 return
 if error\_code == "":
 return

 def error(self, error\_code):
 """
 에러 로깅을 처리합니다.
 """
 self.\_\_log(b'e', error\_code)

 def start\_gigapixel(self):
 """
 기가픽셀을 시작하는 함수
 """
 app = MainGigapixel(EXE\_PATH, OUTPUT\_SUFFIX)
 앱이 None인 경우:
 self.error("기가픽셀을 시작할 수 없습니다, 경로 변수를 확인하고 다시 시도하세요")

 def start\_gigapixel\_thread(self):
 """
 start\_gigapixel 스레드를 초기화하는 함수
 """
 thread = threading.Thread(target=self.start\_gigapixel)
 thread.start()
 thread.join()

 def send\_keys\_clear(self):
 """
 사진을 지우기 위해 키를 기가픽셀로 보내는 함수
 """
 send\_keys("^{W}")

 def process(self, photo\_path: 경로, 스케일: Scale = Scale.X2, mode: 모드 = 모드.표준) -> 경로:
 self.\_check\_path(photo\_path)
 self.send\_keys\_clear()
 self.\_app.open\_photo(사진\_경로)
 self.\_app.set\_processing\_옵션(스케일, 모드)
 self.\_app.save\_photo()
 self.send\_keys\_clear()

 반환 self.\_get\_save\_path(photo\_path)"는 업스케일 위드 클래스 내의 함수에서 호출됩니다.