feat flux 取消污点检测 增加类别判断
fix
This commit is contained in:
@@ -92,6 +92,7 @@ class GenerateImage:
|
||||
image_result = cv2.cvtColor(np.squeeze(image.astype(np.uint8)), cv2.COLOR_RGB2BGR)
|
||||
is_smudge = True
|
||||
if self.category == "sketch" and self.version == "fast":
|
||||
if self.version == "fast":
|
||||
# 色阶调整
|
||||
cutoff = 1
|
||||
levels_img = autoLevels(image_result, cutoff)
|
||||
@@ -109,6 +110,10 @@ class GenerateImage:
|
||||
category, scores, not_smudge_image = generate_category_recognition(image=remove_bg_image, gender=self.gender)
|
||||
self.generate_data['category'] = str(category)
|
||||
image_result = not_smudge_image
|
||||
else:
|
||||
category, scores, not_smudge_image = generate_category_recognition(image=image_result, gender=self.gender)
|
||||
self.generate_data['category'] = str(category)
|
||||
image_result = not_smudge_image
|
||||
if is_smudge: # 无污点
|
||||
# image_result = adjust_contrast(image_result)
|
||||
image_url = upload_png_sd(image_result, user_id=self.user_id, category=f"{self.category}", file_name=f"{self.tasks_id}.png")
|
||||
@@ -190,7 +195,7 @@ def infer_cancel(tasks_id):
|
||||
if __name__ == '__main__':
|
||||
rd = GenerateImageModel(
|
||||
tasks_id="123-89",
|
||||
prompt='a fabric print, flower, yellow, 4k, hud',
|
||||
prompt='a single item of sketch of Wabi-sabi, skirt, tiered, 4k, white background',
|
||||
image_url="aida-collection-element/87/Printboard/842c09cf-7297-42d9-9e6e-9c17d4a13cb5.jpg",
|
||||
mode='txt2img',
|
||||
category="test",
|
||||
|
||||
Reference in New Issue
Block a user