Skip to content

TypeError: download_file() got an unexpected keyword argument 'gen' #2305

Description

@R00G3R

Since updating to the new v13 release, whenever the software attempts to automatically download a missing model (such as Qwen3-VL-4B-Instruct), the execution fails and aborts the task queue due to an unexpected keyword argument (gen) being passed to the download_file function.

Steps to Reproduce

  1. Update to version v13 and initiate a task that requires the automatic download of an uncached model (e.g., Qwen3-VL-4B-Instruct).
  2. The system invokes load_models passing the gen parameter.
  3. download_models attempts to call download_file with gen=gen.
  4. A TypeError is triggered.
Traceback (most recent call last):
  File "D:\Wan2GP\wgp.py", line 3705, in download_models
    download_file(url, filename, gen=gen, show_filename=show_filename)
  File "D:\Wan2GP\wgp.py", line 3618, in download_file
    return shared_download_file(url, filename, gen=gen, show_filename=show_filename)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: download_file() got an unexpected keyword argument 'gen'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Wan2GP\wgp.py", line 8755, in queue_worker_func
    success = generate_media(task, send_cmd, plugin_data=plugin_data,  **filtered_params)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Wan2GP\wgp.py", line 7029, in generate_media
    wan_model, offloadobj = load_models(model_type, override_profile, output_type=output_type, config_id=config, gen=gen, loading_callback=offload.LoadingCallback(lambda: gen.get("abort", False), loading_progress), **model_kwargs)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Wan2GP\wgp.py", line 4103, in load_models
    download_models(filename, file_model_type, file_source_type, submodel_no, model_def = model_def, gen=gen)
  File "D:\Wan2GP\wgp.py", line 3710, in download_models
    raise Exception(f"{prop} '{url}' is invalid: {str(e)}'")
Exception: preload_URLs 'https://huggingface.co/DeepBeepMeep/krea-2/resolve/main/Qwen3-VL-4B-Instruct/Qwen3-VL-4B-Instruct_vision_bf16.safetensors|Qwen3-VL-4B-Instruct' is invalid: download_file() got an unexpected keyword argument 'gen''
WanGP API queue error client_id=api_1789348579079581600_1 aborted=False error=preload_URLs 'https://huggingface.co/DeepBeepMeep/krea-2/resolve/main/Qwen3-VL-4B-Instruct/Qwen3-VL-4B-Instruct_vision_bf16.safetensors|Qwen3-VL-4B-Instruct' is invalid: download_file() got an unexpected keyword argument 'gen''
Error Queue autosaved successfully to error_queue_20260913_221620.zip
Error Queue autosaved successfully to error_queue_20260913_221620.zip
Traceback (most recent call last):
  File "D:\Wan2GP\shared\deepy\hybrid.py", line 202, in _run_generation
    for updates in self._process_queue(self._state):
  File "D:\Wan2GP\wgp.py", line 8825, in _process_tasks
    raise gr.Error(data, print_exception= False, duration = 0)
gradio.exceptions.Error: "preload_URLs 'https://huggingface.co/DeepBeepMeep/krea-2/resolve/main/Qwen3-VL-4B-Instruct/Qwen3-VL-4B-Instruct_vision_bf16.safetensors|Qwen3-VL-4B-Instruct' is invalid: download_file() got an unexpected keyword argument 'gen''"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions