edit : imagen -> gemini로 변경, bingimg -> 사용불가 , 벡터검색api 이미지저장이아닌 데이터 전송하는 api 추가 , vactor -> vector 오타 수정
This commit is contained in:
@@ -57,9 +57,9 @@ class BingArtGenerator:
|
||||
else:
|
||||
return None
|
||||
|
||||
def link_to_img(self, img_links:list):
|
||||
def link_to_img_remote(self, img_links:list):
|
||||
"""
|
||||
이미지 링크로 이미지 파일 저장
|
||||
이미지 링크로 이미지 파일 원격지에 저장
|
||||
"""
|
||||
jpeg_index = 1
|
||||
|
||||
@@ -80,6 +80,20 @@ class BingArtGenerator:
|
||||
return 0
|
||||
|
||||
else:
|
||||
self.link_to_img(img_links=image_links)
|
||||
self.link_to_img_remote(img_links=image_links)
|
||||
return len(image_links)
|
||||
|
||||
def get_query_image(self,prompt):
|
||||
|
||||
create_time = D.date_file_name()
|
||||
|
||||
image_links = self.get_image_links(prompt,1)
|
||||
|
||||
if image_links == None:
|
||||
return 0
|
||||
else:
|
||||
image = image_links[0]
|
||||
query_path = os.path.join(TEMP_FOLDER,f"query_bingarg_{create_time}.png")
|
||||
urllib.request.urlretrieve(image, query_path)
|
||||
|
||||
return query_path
|
||||
|
||||
Reference in New Issue
Block a user