mirror of
https://github.com/Paillat-dev/viralfactory.git
synced 2026-01-02 01:06:19 +00:00
🎨 Run linter
This commit is contained in:
@@ -32,7 +32,7 @@ class A1111AIImageEngine(BaseAIImageEngine):
|
|||||||
|
|
||||||
super().__init__()
|
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
|
max_width = self.ctx.width / 3 * 2
|
||||||
try:
|
try:
|
||||||
url = self.base_url + "/sdapi/v1/txt2img"
|
url = self.base_url + "/sdapi/v1/txt2img"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class BaseAIImageEngine(BaseEngine):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
@abstractmethod
|
@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
|
Ge
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class DallEAIImageEngine(BaseAIImageEngine):
|
|||||||
|
|
||||||
super().__init__()
|
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
|
max_width = self.ctx.width / 3 * 2
|
||||||
size: Literal["1024x1024", "1024x1792", "1792x1024"] = (
|
size: Literal["1024x1024", "1024x1792", "1792x1024"] = (
|
||||||
"1024x1024"
|
"1024x1024"
|
||||||
|
|||||||
@@ -39,7 +39,10 @@ class ScriptedVideoPipeline(BasePipeline):
|
|||||||
def get_assets_concurrent(self, assets: list[dict[str, str]]) -> list[mp.VideoClip]:
|
def get_assets_concurrent(self, assets: list[dict[str, str]]) -> list[mp.VideoClip]:
|
||||||
results = []
|
results = []
|
||||||
with ThreadPoolExecutor() as executor:
|
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):
|
for future in as_completed(futures):
|
||||||
try:
|
try:
|
||||||
results.append(future.result())
|
results.append(future.result())
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class BaseStockImageEngine(BaseEngine):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
@abstractmethod
|
@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.
|
Get a stock image based on a query.
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,9 @@ class GoogleStockImageEngine(BaseStockImageEngine):
|
|||||||
custom_image_name="temp",
|
custom_image_name="temp",
|
||||||
)
|
)
|
||||||
# we find the file called temp. extension
|
# 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}")
|
img = mp.ImageClip(f"./temp{i}/{filename}")
|
||||||
# delete the temp folder
|
# delete the temp folder
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user