Skip to content

Commit 6c62194

Browse files
akaitsuki-iiGlaceon-Hyy
authored andcommitted
remove redundant config
1 parent be9606f commit 6c62194

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

diffsynth_engine/pipelines/qwen_image.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,8 @@ def __init__(
8282
dtype=config.model_dtype,
8383
)
8484
self.config = config
85-
self.tokenizer_max_length = 1024
8685
self.prompt_template_encode = "<|im_start|>system\nDescribe the image by detailing the color, shape, size, texture, quantity, text, spatial relationships of the objects and background:<|im_end|>\n<|im_start|>user\n{}<|im_end|>\n<|im_start|>assistant\n"
8786
self.prompt_template_encode_start_idx = 34
88-
self.default_sample_size = 128
8987
# sampler
9088
self.noise_scheduler = RecifitedFlowScheduler(shift=3.0, use_dynamic_shifting=True)
9189
self.sampler = FlowMatchEulerSampler()
@@ -262,7 +260,7 @@ def encode_prompt(
262260
template = self.prompt_template_encode
263261
drop_idx = self.prompt_template_encode_start_idx
264262
texts = [template.format(txt) for txt in prompt]
265-
outputs = self.tokenizer(texts, max_length=min(max_sequence_length, self.tokenizer_max_length) + drop_idx)
263+
outputs = self.tokenizer(texts, max_length=max_sequence_length + drop_idx)
266264
input_ids, attention_mask = outputs["input_ids"].to(self.device), outputs["attention_mask"].to(self.device)
267265
outputs = self.encoder(input_ids=input_ids, attention_mask=attention_mask)
268266
hidden_states = outputs["hidden_states"]

0 commit comments

Comments
 (0)