feat generate 迁移

This commit is contained in:
zhouchengrong
2024-04-15 18:26:48 +08:00
parent f8493dbdb6
commit 83d79c14ef
5 changed files with 12 additions and 43 deletions

View File

@@ -26,7 +26,7 @@ def upload_png_sd(image, user_id, category, object_name):
image.save(image_data, format='PNG')
image_data.seek(0)
image_bytes = image_data.read()
image_url = f"aida-users/{minio_client.put_object(f'aida-users', f'{user_id}/{category}/{object_name}', io.BytesIO(image_bytes), len(image_bytes), content_type='image/png').object_name}"
image_url = f"aida-users/{minio_client.put_object(f'{GI_MINIO_BUCKET}', f'{user_id}/{category}/{object_name}', io.BytesIO(image_bytes), len(image_bytes), content_type='image/png').object_name}"
return image_url
except Exception as e: