scooter7 commited on
Commit
e7b434b
·
verified ·
1 Parent(s): ee63c25

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -122,7 +122,7 @@ def generate(
122
  inference_steps: int = 4,
123
  randomize_seed: bool = False,
124
  use_resolution_binning: bool = True,
125
- **color_ratios # Collect color ratios dynamically
126
  ):
127
  seed = int(randomize_seed_fn(seed, randomize_seed))
128
  generator = torch.Generator().manual_seed(seed)
@@ -131,7 +131,10 @@ def generate(
131
  negative_prompt = None # type: ignore
132
 
133
  # Process color selections and their ratios
134
- color_selections = {color: {"selected": color_ratios.get(f"{color.lower()}_selected", False), "ratio": color_ratios.get(f"{color.lower()}_ratio", 0)} for color in color_attributes}
 
 
 
135
 
136
  # Apply style and modify prompt based on color selections
137
  prompt, negative_prompt = apply_style(style, prompt, color_selections)
 
122
  inference_steps: int = 4,
123
  randomize_seed: bool = False,
124
  use_resolution_binning: bool = True,
125
+ **kwargs # This will capture all other keyword arguments dynamically
126
  ):
127
  seed = int(randomize_seed_fn(seed, randomize_seed))
128
  generator = torch.Generator().manual_seed(seed)
 
131
  negative_prompt = None # type: ignore
132
 
133
  # Process color selections and their ratios
134
+ # Extract color selections and ratios from kwargs
135
+ color_selections = {color: {"selected": kwargs.get(f"{color.lower()}_selected", False),
136
+ "ratio": kwargs.get(f"{color.lower()}_ratio", 0)}
137
+ for color in color_attributes}
138
 
139
  # Apply style and modify prompt based on color selections
140
  prompt, negative_prompt = apply_style(style, prompt, color_selections)