Skip to content

Commit

Permalink
Update nodes.py
Browse files Browse the repository at this point in the history
streamline simple node settings
  • Loading branch information
kaibioinfo authored Nov 23, 2024
1 parent 4f6b78d commit 37136e1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def automerge(tensor, threshold):
newTensor.append(torch.stack(tokens))
return torch.stack(newTensor)

STRENGTHS = ["very high", "high", "medium", "low", "very low"]
STRENGTHS_VALUES = [1,2, 3,4,5]
STRENGTHS = ["highest", "high", "medium", "low", "lowest"]
STRENGTHS_VALUES = [1,2,3,4,5]

class StyleModelApplySimple:
@classmethod
Expand All @@ -51,7 +51,7 @@ def INPUT_TYPES(s):
def apply_stylemodel(self, clip_vision_output, style_model, conditioning, image_strength):
stren = STRENGTHS.index(image_strength)
downsampling_factor = STRENGTHS_VALUES[stren]
mode="area"
mode="area" if downsampling_factor==3 else "bicubic"
cond = style_model.get_cond(clip_vision_output).flatten(start_dim=0, end_dim=1).unsqueeze(dim=0)
if downsampling_factor>1:
(b,t,h)=cond.shape
Expand Down Expand Up @@ -140,4 +140,4 @@ def apply_stylemodel(self, clip_vision_output, style_model, conditioning, downsa
"StyleModelApplySimple": "Apply style model (simple)",
"StyleModelApplyAdvanced": "Apply Style model (advanced)",
"StyleModelApplyInterpolation": "Apply style model (advanced)"
}
}

0 comments on commit 37136e1

Please sign in to comment.