diff --git a/src/novelai_python/server.py b/src/novelai_python/server.py index 1829b56..4376a63 100755 --- a/src/novelai_python/server.py +++ b/src/novelai_python/server.py @@ -190,7 +190,6 @@ async def generator(): generator = agent.request(session=session) async for data in generator: data: LLMStreamResp - print(data) # 或者做其他需要的处理 yield data.text # Yield data for streaming response return StreamingResponse(generator()) diff --git a/src/novelai_python/tool/image_metadata/__init__.py b/src/novelai_python/tool/image_metadata/__init__.py index 1d32483..ac773c3 100644 --- a/src/novelai_python/tool/image_metadata/__init__.py +++ b/src/novelai_python/tool/image_metadata/__init__.py @@ -3,7 +3,7 @@ import json from io import BytesIO from pathlib import Path -from typing import Union +from typing import Union, Optional, List import numpy as np from PIL import Image @@ -36,8 +36,10 @@ class CommentModel(BaseModel): hide_debug_overlay: bool = None noise_schedule: str = None legacy_v3_extend: bool = None - reference_information_extracted: float = None - reference_strength: float = None + reference_information_extracted: Optional[float] = None + reference_strength: Optional[float] = None + reference_strength_multiple: Optional[List[float]] = None + reference_information_extracted_multiple: Optional[List[float]] = None sampler: str = None controlnet_strength: float = None controlnet_model: Union[None, str] = None @@ -58,6 +60,26 @@ class CommentModel(BaseModel): def negative_prompt(self): return self.uc + @property + def vibe_transfer_strength(self) -> List[float]: + """ + Get the vibe transfer strength totally + :return: List[float] + """ + if self.reference_strength: + return [self.reference_strength] + return self.reference_strength_multiple + + @property + def vibe_transfer_information(self) -> List[float]: + """ + Get the vibe transfer information totally + :return: List[float] + """ + if self.reference_information_extracted: + return [self.reference_information_extracted] + return self.reference_information_extracted_multiple + Title: str = "AI generated image" Software: str = "NovelAI" Source: str = None