🎨 Run linter

This commit is contained in:
2024-05-17 11:26:45 +02:00
parent b26d99ef0e
commit 4fa347242b
6 changed files with 11 additions and 6 deletions

View File

@@ -32,7 +32,7 @@ class A1111AIImageEngine(BaseAIImageEngine):
super().__init__()
def generate(self, prompt: str, start: float, end: float, i= "") -> mp.ImageClip:
def generate(self, prompt: str, start: float, end: float, i="") -> mp.ImageClip:
max_width = self.ctx.width / 3 * 2
try:
url = self.base_url + "/sdapi/v1/txt2img"

View File

@@ -11,7 +11,7 @@ class BaseAIImageEngine(BaseEngine):
"""
@abstractmethod
def generate(self, prompt: str, start: float, end: float, i = "") -> mp.ImageClip:
def generate(self, prompt: str, start: float, end: float, i="") -> mp.ImageClip:
"""
Ge
"""

View File

@@ -33,7 +33,7 @@ class DallEAIImageEngine(BaseAIImageEngine):
super().__init__()
def generate(self, prompt: str, start: float, end: float, i = "") -> mp.ImageClip:
def generate(self, prompt: str, start: float, end: float, i="") -> mp.ImageClip:
max_width = self.ctx.width / 3 * 2
size: Literal["1024x1024", "1024x1792", "1792x1024"] = (
"1024x1024"

View File

@@ -39,7 +39,10 @@ class ScriptedVideoPipeline(BasePipeline):
def get_assets_concurrent(self, assets: list[dict[str, str]]) -> list[mp.VideoClip]:
results = []
with ThreadPoolExecutor() as executor:
futures = [executor.submit(self.get_asset, asset, i) for i, asset in enumerate(assets)]
futures = [
executor.submit(self.get_asset, asset, i)
for i, asset in enumerate(assets)
]
for future in as_completed(futures):
try:
results.append(future.result())

View File

@@ -11,7 +11,7 @@ class BaseStockImageEngine(BaseEngine):
"""
@abstractmethod
def get(self, query: str, start: float, end: float, i = "") -> mp.ImageClip:
def get(self, query: str, start: float, end: float, i="") -> mp.ImageClip:
"""
Get a stock image based on a query.

View File

@@ -42,7 +42,9 @@ class GoogleStockImageEngine(BaseStockImageEngine):
custom_image_name="temp",
)
# we find the file called temp. extension
filename = [f for f in os.listdir(f"./temp{i}/") if f.startswith("temp.")][0]
filename = [f for f in os.listdir(f"./temp{i}/") if f.startswith("temp.")][
0
]
img = mp.ImageClip(f"./temp{i}/{filename}")
# delete the temp folder
except Exception as e: