Skip to content

Commit 20e3048

Browse files
author
longgui0318
committed
fix bugs
1 parent 15e27d0 commit 20e3048

57 files changed

Lines changed: 3 additions & 1126 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

py/wavespeed_api/requests/dia_tts.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ class DiaTts(BaseRequest):
1313
...,
1414
description="The text to be converted to speech.")
1515

16-
def __init__(self, prompt: str, **kwargs):
17-
super().__init__(**kwargs)
18-
self.prompt = prompt
19-
2016
def build_payload(self) -> dict:
2117
"""Builds the request payload dictionary."""
2218
payload = {

py/wavespeed_api/requests/flux_control_lora_canny.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,34 +26,6 @@ class FluxControlLoraCanny(BaseRequest):
2626
width: Optional[int] = Field(864, description="The width of the generated image.", ge=512, le=1536)
2727
height: Optional[int] = Field(1536, description="The height of the generated image.", ge=512, le=1536)
2828

29-
def __init__(
30-
self,
31-
prompt: str,
32-
control_image: Optional[str] = None,
33-
control_scale: Optional[float] = 1,
34-
enable_safety_checker: Optional[bool] = True,
35-
guidance_scale: Optional[float] = 3.5,
36-
loras: Optional[List[Union[LoraWeightItem, Dict[str, Any]]]] = None, # Allow dicts for easier init
37-
num_images: Optional[int] = 1,
38-
num_inference_steps: Optional[int] = 28,
39-
seed: Optional[int] = -1,
40-
width: Optional[int] = 864,
41-
height: Optional[int] = 1536,
42-
**kwargs):
43-
super().__init__(**kwargs)
44-
self.prompt = prompt
45-
self.control_image = control_image
46-
self.control_scale = control_scale
47-
self.enable_safety_checker = enable_safety_checker
48-
self.guidance_scale = guidance_scale
49-
if loras is not None:
50-
self.loras = [LoraWeightItem(**lora) if isinstance(lora, dict) else lora for lora in loras]
51-
self.num_images = num_images
52-
self.num_inference_steps = num_inference_steps
53-
self.seed = seed
54-
self.width = width
55-
self.height = height
56-
5729
def build_payload(self) -> dict:
5830
"""Builds the request payload dictionary."""
5931
payload = {

py/wavespeed_api/requests/flux_control_lora_depth.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -32,34 +32,6 @@ class FluxControlLoraDepth(BaseRequest):
3232
width: Optional[int] = Field(864, description="The width of the generated image.", ge=512, le=1536)
3333
height: Optional[int] = Field(1536, description="The height of the generated image.", ge=512, le=1536)
3434

35-
def __init__(
36-
self,
37-
prompt: str,
38-
control_image: Optional[str] = None,
39-
control_scale: Optional[float] = 1,
40-
enable_safety_checker: Optional[bool] = True,
41-
guidance_scale: Optional[float] = 3.5,
42-
loras: Optional[List[Union[LoraWeightItem, Dict[str, Any]]]] = None, # Allow dicts for easier init
43-
num_images: Optional[int] = 1,
44-
num_inference_steps: Optional[int] = 28,
45-
seed: Optional[int] = -1,
46-
width: Optional[int] = 864,
47-
height: Optional[int] = 1536,
48-
**kwargs):
49-
super().__init__(**kwargs)
50-
self.prompt = prompt
51-
self.control_image = control_image
52-
self.control_scale = control_scale
53-
self.enable_safety_checker = enable_safety_checker
54-
self.guidance_scale = guidance_scale
55-
if loras is not None:
56-
self.loras = [LoraWeightItem(**lora) if isinstance(lora, dict) else lora for lora in loras]
57-
self.num_images = num_images
58-
self.num_inference_steps = num_inference_steps
59-
self.seed = seed
60-
self.width = width
61-
self.height = height
62-
6335
def build_payload(self) -> dict:
6436
"""Builds the request payload dictionary."""
6537
payload = {

py/wavespeed_api/requests/flux_dev.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,6 @@ class FluxDev(BaseRequest):
2121
height: Optional[int] = Field(default=1024, description="The height of the generated image." , ge=512, le=1536)
2222
strength: Optional[float] = Field(default=0.8, description="Strength indicates extent to transform the reference image", ge=0, le=1)
2323

24-
def __init__(
25-
self,
26-
prompt: str,
27-
enable_safety_checker: Optional[bool] = True,
28-
guidance_scale: Optional[float] = 3.5,
29-
image: Optional[str] = None,
30-
mask_image: Optional[str] = None,
31-
num_images: Optional[int] = 1,
32-
num_inference_steps: Optional[int] = 28,
33-
seed: Optional[int] = -1,
34-
width: Optional[int] = 1024,
35-
height: Optional[int] = 1024,
36-
strength: Optional[float] = 0.8,
37-
**kwargs):
38-
super().__init__(**kwargs)
39-
40-
self.prompt = prompt
41-
self.enable_safety_checker = enable_safety_checker
42-
self.guidance_scale = guidance_scale
43-
self.image = image
44-
self.mask_image = mask_image
45-
self.num_images = num_images
46-
self.num_inference_steps = num_inference_steps
47-
self.seed = seed
48-
self.width = width
49-
self.height = height
50-
self.strength = strength
5124

5225
def build_payload(self) -> dict:
5326
"""Builds the request payload dictionary."""

py/wavespeed_api/requests/flux_dev_fill.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,6 @@ class FluxDevFill(BaseRequest):
2525
width: Optional[int] = Field(default=864, description="The width of the generated image.", ge=512, le=1536)
2626
height: Optional[int] = Field(default=1536, description="The height of the generated image.", ge=512, le=1536)
2727

28-
def __init__(
29-
self,
30-
image: str,
31-
mask_image: Optional[str] = None,
32-
prompt: Optional[str] = None,
33-
num_inference_steps: Optional[int] = 28,
34-
seed: Optional[int] = -1,
35-
guidance_scale: Optional[float] = 30,
36-
num_images: Optional[int] = 1,
37-
loras: Optional[List[Union[LoraWeightItem, Dict[str, Any]]]] = None, # Allow dicts for easier init
38-
enable_safety_checker: Optional[bool] = True,
39-
width: Optional[int] = 864,
40-
height: Optional[int] = 1536,
41-
**kwargs):
42-
super().__init__(**kwargs)
43-
44-
self.image = image
45-
self.mask_image = mask_image
46-
self.prompt = prompt
47-
self.num_inference_steps = num_inference_steps
48-
self.seed = seed
49-
self.guidance_scale = guidance_scale
50-
self.num_images = num_images
51-
self.width = width
52-
self.height = height
53-
if loras is not None:
54-
self.loras = [LoraWeightItem(**lora) if isinstance(lora, dict) else lora for lora in loras]
55-
self.enable_safety_checker = enable_safety_checker
56-
5728
def build_payload(self) -> dict:
5829
"""Builds the request payload dictionary."""
5930
payload = {

py/wavespeed_api/requests/flux_dev_lora.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -24,36 +24,6 @@ class FluxDevLora(BaseRequest):
2424
height: Optional[int] = Field(default=1024, description="The height of the generated image.", ge=512, le=1536)
2525
strength: Optional[float] = Field(default=0.8, description="Strength indicates extent to transform the reference image", maximum=1, minimum=0)
2626

27-
def __init__(
28-
self,
29-
prompt: str,
30-
enable_safety_checker: Optional[bool] = True,
31-
guidance_scale: Optional[float] = 3.5,
32-
image: Optional[str] = None,
33-
loras: Optional[List[Union[LoraWeightItem, Dict[str, Any]]]] = None, # Allow dicts for easier init
34-
mask_image: Optional[str] = None,
35-
num_images: Optional[int] = 1,
36-
num_inference_steps: Optional[int] = 28,
37-
seed: Optional[int] = -1,
38-
width: Optional[int] = 1024,
39-
height: Optional[int] = 1024,
40-
strength: Optional[float] = 0.8,
41-
**kwargs):
42-
super().__init__(**kwargs)
43-
self.prompt = prompt
44-
self.enable_safety_checker = enable_safety_checker
45-
self.guidance_scale = guidance_scale
46-
self.image = image
47-
if loras is not None:
48-
self.loras = [LoraWeightItem(**lora) if isinstance(lora, dict) else lora for lora in loras]
49-
self.mask_image = mask_image
50-
self.num_images = num_images
51-
self.num_inference_steps = num_inference_steps
52-
self.seed = seed
53-
self.width = width
54-
self.height = height
55-
self.strength = strength
56-
5727
def build_payload(self) -> dict:
5828
"""Builds the request payload dictionary."""
5929
payload = {

py/wavespeed_api/requests/flux_dev_lora_ultra_fast.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -32,36 +32,6 @@ class FluxDevLoraUltraFast(BaseRequest):
3232
seed: Optional[int] = Field(default=-1, description="Random seed (-1 for random)")
3333
enable_safety_checker: Optional[bool] = Field(default=True, description="Enable safety checker")
3434

35-
def __init__(
36-
self,
37-
prompt: str,
38-
image: Optional[str] = "",
39-
mask_image: Optional[str] = None,
40-
strength: Optional[float] = 0.8,
41-
loras: Optional[List[Union[LoraWeightItem, Dict[str, Any]]]] = None, # Allow dicts for easier init
42-
width: Optional[int] = 1024,
43-
height: Optional[int] = 1024,
44-
num_inference_steps: Optional[int] = 28,
45-
guidance_scale: Optional[float] = 3.5,
46-
num_images: Optional[int] = 1,
47-
seed: Optional[int] = -1,
48-
enable_safety_checker: Optional[bool] = True,
49-
**kwargs):
50-
super().__init__(**kwargs)
51-
self.prompt = prompt
52-
self.image = image
53-
self.mask_image = mask_image
54-
self.strength = strength
55-
if loras is not None:
56-
self.loras = [LoraWeightItem(**lora) if isinstance(lora, dict) else lora for lora in loras]
57-
self.width = width
58-
self.height = height
59-
self.num_inference_steps = num_inference_steps
60-
self.guidance_scale = guidance_scale
61-
self.num_images = num_images
62-
self.seed = seed
63-
self.enable_safety_checker = enable_safety_checker
64-
6535
def build_payload(self) -> dict:
6636
"""Builds the request payload dictionary."""
6737
payload = {

py/wavespeed_api/requests/flux_dev_ultra_fast.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,33 +28,6 @@ class FluxDevUltraFast(BaseRequest):
2828
height: Optional[int] = Field(default=1024, description="The height of the generated image.", ge=512, le=1536)
2929
strength: Optional[float] = Field(default=0.8, description="Strength indicates extent to transform the reference image", maximum=1, minimum=0, step=0.1, title="Strength")
3030

31-
def __init__(
32-
self,
33-
prompt: str,
34-
enable_safety_checker: Optional[bool] = True,
35-
guidance_scale: Optional[float] = 3.5,
36-
image: Optional[str] = None,
37-
mask_image: Optional[str] = None,
38-
num_images: Optional[int] = 1,
39-
num_inference_steps: Optional[int] = 28,
40-
seed: Optional[int] = -1,
41-
width: Optional[int] = 1024,
42-
height: Optional[int] = 1024,
43-
strength: Optional[float] = 0.8,
44-
**kwargs: Any):
45-
super().__init__(**kwargs)
46-
self.enable_safety_checker = enable_safety_checker
47-
self.guidance_scale = guidance_scale
48-
self.image = image
49-
self.mask_image = mask_image
50-
self.num_images = num_images
51-
self.num_inference_steps = num_inference_steps
52-
self.prompt = prompt
53-
self.seed = seed
54-
self.width = width
55-
self.height = height
56-
self.strength = strength
57-
5831
def build_payload(self) -> dict:
5932
"""Builds the request payload dictionary."""
6033
payload = {

py/wavespeed_api/requests/flux_pro_redux.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,6 @@ class FluxProRedux(BaseRequest):
2020
num_images: int = Field(default=1, description="The number of images to generate.", title="Num Images")
2121
enable_safety_checker: bool = Field(default=True, description="If set to true, the safety checker will be enabled.", title="Enable Safety Checker")
2222

23-
def __init__(
24-
self,
25-
image: str,
26-
prompt: str = "",
27-
width: int = 1024,
28-
height: int = 1024,
29-
seed: int = 0,
30-
num_inference_steps: int = 28,
31-
guidance_scale: float = 3.5,
32-
num_images: int = 1,
33-
enable_safety_checker: bool = True,
34-
**kwargs):
35-
super().__init__(**kwargs)
36-
self.image = image
37-
self.prompt = prompt
38-
self.width = width
39-
self.height = height
40-
self.seed = seed
41-
self.num_inference_steps = num_inference_steps
42-
self.guidance_scale = guidance_scale
43-
self.num_images = num_images
44-
self.enable_safety_checker = enable_safety_checker
45-
4623
def build_payload(self) -> dict:
4724
"""Builds the request payload dictionary."""
4825
payload = {

py/wavespeed_api/requests/flux_redux_dev.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,6 @@ class FluxReduxDev(BaseRequest):
2121
width: Optional[int] = Field(default=1024, description="The width of the generated image.", ge=512, le=1536)
2222
height: Optional[int] = Field(default=1024, description="The height of the generated image.", ge=512, le=1536)
2323

24-
def __init__(
25-
self,
26-
image: str,
27-
enable_safety_checker: Optional[bool] = True,
28-
guidance_scale: Optional[float] = 3.5,
29-
num_images: Optional[int] = 1,
30-
num_inference_steps: Optional[int] = 28,
31-
seed: Optional[int] = -1,
32-
width: Optional[int] = 1024,
33-
height: Optional[int] = 1024,
34-
**kwargs):
35-
super().__init__(**kwargs)
36-
self.enable_safety_checker = enable_safety_checker
37-
self.guidance_scale = guidance_scale
38-
self.image = image
39-
self.num_images = num_images
40-
self.num_inference_steps = num_inference_steps
41-
self.seed = seed
42-
self.width = width
43-
self.height = height
44-
4524
def build_payload(self) -> dict:
4625
"""Builds the request payload dictionary."""
4726
payload = {

0 commit comments

Comments
 (0)