mindfulmandy commited on
Commit
5a7938b
·
1 Parent(s): 785ed35

Upload folder using huggingface_hub

Browse files
model_index.json CHANGED
@@ -9,6 +9,10 @@
9
  "transformers",
10
  "Qwen3VLForConditionalGeneration"
11
  ],
 
 
 
 
12
  "transformer": [
13
  "modeling_nucleusmoe",
14
  "NucleusMoEImageTransformer2DModel"
 
9
  "transformers",
10
  "Qwen3VLForConditionalGeneration"
11
  ],
12
+ "processor": [
13
+ "processor",
14
+ "Qwen3VLProcessor"
15
+ ],
16
  "transformer": [
17
  "modeling_nucleusmoe",
18
  "NucleusMoEImageTransformer2DModel"
pipeline_nucleusmoe.py CHANGED
@@ -153,36 +153,17 @@ class NucleusMoEImagePipeline(DiffusionPipeline):
153
  """
154
 
155
  model_cpu_offload_seq = "text_encoder->transformer->vae"
156
- _optional_components = ["processor"]
157
  _callback_tensor_inputs = ["latents", "prompt_embeds"]
158
 
159
- @classmethod
160
- def from_pretrained(cls, pretrained_model_name_or_path, **kwargs):
161
- if "processor" not in kwargs:
162
- kwargs["processor"] = Qwen3VLProcessor.from_pretrained(
163
- pretrained_model_name_or_path, subfolder="text_encoder"
164
- )
165
- return super().from_pretrained(pretrained_model_name_or_path, **kwargs)
166
-
167
  def __init__(
168
  self,
169
  transformer: NucleusMoEImageTransformer2DModel,
170
  scheduler: FlowMatchEulerDiscreteScheduler,
171
  vae: AutoencoderKLQwenImage,
172
  text_encoder: Qwen3VLForConditionalGeneration,
173
- processor: Qwen3VLProcessor | None = None,
174
  ):
175
  super().__init__()
176
- if processor is None:
177
- processor_path = (
178
- getattr(text_encoder, "name_or_path", None)
179
- or getattr(getattr(text_encoder, "config", None), "_name_or_path", None)
180
- )
181
- if processor_path is None:
182
- raise ValueError(
183
- "Could not infer a processor path from `text_encoder`; pass `processor=` explicitly."
184
- )
185
- processor = Qwen3VLProcessor.from_pretrained(processor_path)
186
  self.register_modules(
187
  transformer=transformer,
188
  scheduler=scheduler,
 
153
  """
154
 
155
  model_cpu_offload_seq = "text_encoder->transformer->vae"
 
156
  _callback_tensor_inputs = ["latents", "prompt_embeds"]
157
 
 
 
 
 
 
 
 
 
158
  def __init__(
159
  self,
160
  transformer: NucleusMoEImageTransformer2DModel,
161
  scheduler: FlowMatchEulerDiscreteScheduler,
162
  vae: AutoencoderKLQwenImage,
163
  text_encoder: Qwen3VLForConditionalGeneration,
164
+ processor: Qwen3VLProcessor,
165
  ):
166
  super().__init__()
 
 
 
 
 
 
 
 
 
 
167
  self.register_modules(
168
  transformer=transformer,
169
  scheduler=scheduler,
processor/preprocessor_config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "size": {
3
+ "longest_edge": 16777216,
4
+ "shortest_edge": 65536
5
+ },
6
+ "patch_size": 16,
7
+ "temporal_patch_size": 2,
8
+ "merge_size": 2,
9
+ "image_mean": [
10
+ 0.5,
11
+ 0.5,
12
+ 0.5
13
+ ],
14
+ "image_std": [
15
+ 0.5,
16
+ 0.5,
17
+ 0.5
18
+ ],
19
+ "processor_class": "Qwen3VLProcessor",
20
+ "image_processor_type": "Qwen2VLImageProcessorFast"
21
+ }