§
     ’Þjâ'  ã                  óX   — d dl mZ d dlZd dlZd dlmZ d dlmZ d dlm	Z	 dd„Z
ddd„ZdS )é    )ÚannotationsN)ÚSequence)Úload_lora_config)Úserver_portÚargvúSequence[str]ÚnameÚstrÚreturnÚboolc                ó:   ‡— t          ˆfd„| D ¦   «         ¦  «        S )Nc              3  ón   •K  — | ]/}|‰k    p$t          |¦  «                             ‰› d �¦  «        V — Œ0dS )ú=N)r
   Ú
startswith)Ú.0Úone_argr	   s     €ú7C:\Users\johnn\OneDrive\Documents\AI\shared\cli_args.pyú	<genexpr>z _arg_provided.<locals>.<genexpr>   sF   øè è € ÐZÐZÈ'ˆw˜$ŠÐE¥# g¡,¤,×"9Ò"9¸T¸*¸*¸*Ñ"EÔ"EÐZÐZÐZÐZÐZÐZó    )Úany)r   r	   s    `r   Ú_arg_providedr      s'   ø€ ÝÐZÐZÐZÐZÐUYÐZÑZÔZÑZÔZÐZr   Úconfig_filenameúSequence[str] | Nonec           	     ó~  — ddl m} t          |€t          j        dd …         n|¦  «        }t          j        d¬¦  «        }|j        } |ddd¬	¦  «          |d
dd¬	¦  «          |ddd¬	¦  «          |ddd¬	¦  «          |dt          dd¬¦  «          |ddd¬	¦  «          |ddd¬	¦  «          |ddd¬	¦  «          |ddd¬	¦  «          |ddd¬	¦  «          |ddd¬	¦  «          |d t          d!d"¬¦  «          |d#dd$¬	¦  «          |d%t          d&d'¬¦  «          |d(t          i d)d*¬+¦  «          |d,dd-¬	¦  «          |d.t          d&d/¬¦  «          |d0t          d1d2¬¦  «          |d3t          d&d4| › d5�¬¦  «          |d6t          d7d8¬¦  «          |d9t          dd:¬¦  «          |d;t          d d<¬¦  «          |d=t          d&d>d?¬+¦  «          |d@t          d&d>dA¬+¦  «          |dBt          d&d>dC¬+¦  «          |dDt          ddE¬¦  «          |dFt          ddG¬¦  «          |dHt          d7dI¬¦  «          |dJddK¬	¦  «          |dLddM¬	¦  «          |dNddO¬	¦  «          |dPt          ddQ¬¦  «          |dRt          d&dS¬¦  «          |dTt          ddU¬¦  «          |dVt          ddWdX¬+¦  «          |dYt          dZd[ddWd\¬]¦  «          |d^d_d`gd da¬b¦  «          |dcg dd¢d de¬b¦  «          |dft
          j        d dg¬h¦  «          |dit          d&dj¬¦  «          |dkt          d&dl¬¦  «          |dmddn¬	¦  «          |dodt
          j        ¬	¦  «          |dpdt
          j        ¬	¦  «          |dqdt
          j        ¬	¦  «          |drdt
          j        ¬	¦  «          |dsdt
          j        ¬	¦  «          |dtdt
          j        ¬	¦  «          |dudt
          j        ¬	¦  «          |dvddw¬	¦  «          |dxddy¬	¦  «          |dzt          d&d{¬¦  «          |d|t          d&d}¬¦  «          |d~t          d&d¬¦  «          |d€dd�¬	¦  «          |d‚ddƒ¬	¦  «         dd„lm}  ||¦  «          |d…d |d†¬‡¦  «          |dˆdd‰¬	¦  «          |dŠdd‹¬	¦  «          |dŒt
          j        d d�¬h¦  «          |dŽt          d&d�¬¦  «          |d�t          d&d‘¬¦  «          |d’t           d d“¬¦  «          |d”d•d–d—¬b¦  «          |d˜dd™¬	¦  «          |dšdd›¬	¦  «          |dœdd�¬	¦  «          |džddŸ¬	¦  «          |d t          d&d¡¬¦  «          |d¢dd£¬	¦  «          |d¤dd¥¬	¦  «          |d¦dd§¬	¦  «         |                     |¦  «        }|j        rdd¨lm}  ||j        ¦  «         |j        rt-          |d9¦  «        sd!|_        |S )©Nr   )Únormalize_deepy_voice_languageé   z9Generate a video from a text prompt or image using Gradio)Údescriptionz--save-masksÚ
store_truez0save proprocessed masks for debugging or editing)ÚactionÚhelpz--save-speakerszLsave proprocessed audio track with extract speakers for debugging or editingz--debug-gen-formz#View form generation / refresh timez
--betatestztest unreleased featuresz--vram-safety-coefficientg333333ë?zGmax VRAM (between 0 and 1) that should be allocated to preloaded models)ÚtypeÚdefaultr    z--sharez0Create a shared URL to access webserver remotelyz--lock-configz:Prevent modifying the configuration from the web interfacez--lock-modelzPrevent switch modelsz--save-quantizedz-Save a quantized version of the current modelz	--convrotzDSave INT8 ConvRot instead of Quanto INT8 (requires --save-quantized)z--testz.Load the model and exit generation immediatelyz	--preloadÚ0z›Megabytes of each model to preload in VRAM, at least (initial budget for dynamic profiles 1/3; overrides the Configuration preload of every kind of output)z--multiple-imagesz3Allow inputting multiple images with image to videoz--lorasÚ z&Root folder for LoRAs (default: loras)z--lora-configÚFILEz4JSON mapping LoRA subfolder names to directory paths)r!   r"   Úmetavarr    z--check-loraszFilter Loras that are not validz--lora-presetzLora preset to preloadz
--settingsÚsettingszPath to settings folderz--configzPath to config folder for z and queue.zipz	--profileéÿÿÿÿz
Profile Noz	--verbosezVerbose levelz--debug-deepyzCEnable Deepy verbose debug logging and write it to the given folderz--deepy-sessions-dirÚFOLDERzEStore persistent Deepy sessions in FOLDER (default: ./deepy_sessions)z--workspaces-dirzjWorkspace manifests and dedicated media folders (overrides Configuration / Outputs; default: ./workspaces)z--llm-iozPWrite a plain-text transcript of all local and remote LLM input/output to FOLDERz--stepszdefault denoising stepsz--frameszdefault number of framesz--seedzdefault generation seedz
--advancedz"Access advanced options by defaultz--fp16z For using fp16 transformer modelz--bf16z For using bf16 transformer modelz--server-portzServer portz--themezset UI Themez--perc-reserved-mem-maxz†Share of RAM that pinning may lock, as a fraction, e.g. 0.4 (default: the Configuration setting, else 0.4 on Windows and 0.6 on Linux)z--vram-debugÚMIN_MBzßDebug mode of the MMGP VRAM allocator: records the allocations of MIN_MB and more (module, tags, Python stack) and writes after each generation a report of the tensors alive at the peak of each phase in <outputs>/vram_debugz--ram-debugÚ?é   av  RAM debug mode (MIN_MB 16 when omitted): after each generation and each model release, writes in <outputs>/ram_debug a report of where the process's RAM goes (PyTorch and C allocators with what they keep free, pinned memory, CUDA, mapped files, the objects alive and what holds them) with the peak of each phase; CPU allocations of MIN_MB and more are traced to their source)r!   ÚnargsÚconstr"   r&   r    z--ram-allocatorr"   Úmmgpa#  RAM allocator for CPU tensors, applied at startup: mmgp (MMGP RAM Allocator, the default: the RAM of freed tensors goes back to the system when the queue is done, a model is released or the RAM runs short) or default (PyTorch's, which keeps it for reuse). Overrides the Configuration setting)Úchoicesr"   r    z--vram-allocator)r"   ÚvmmÚ	vmm_spilla'  VRAM allocator, applied at startup: vmm_spill (MMGP Optimized VRAM Allocator, the default, with RAM spilling: a generation slightly too large for the VRAM can finish, slowly), vmm (the same, an out of memory error when no VRAM is left) or default (PyTorch's). Overrides the Configuration settingz--prevent-power-throttlingzªWindows: override Configuration / Performance to keep full CPU speed in the background (enabled by default; --no-prevent-power-throttling lets Windows save power instead))r   r"   r    z--server-namezServer namez--gpuzDefault GPU Devicez--open-browserzopen browserz--t2vz--i2vz	--t2v-14Bz
--t2v-1-3Bz--vace-1-3Bz
--i2v-1-3Bz	--i2v-14Bz	--compilezEnable pytorch compilationz--listenz"Server accessible on local networkz--attentionzattention modez--vae-configzvae config modez	--processzRProcess a saved queue (.zip) or settings file (.json) without launching the web UIz	--offlinezvNever download anything: use only the files already on this computer; a missing file stops the operation with an errorz--deepy-serverz>Serve the Deepy chat and media galleries without the Gradio UI)Úadd_argumentsz--deepy-voice-languagezfOverride the configured Whisper dictation language, e.g. fr, en or auto (default: Deepy configuration))r"   r!   r    z--ask-deepyzGStart an interactive Deepy console session without launching the web UIz--mcpz9Start WanGP as an MCP server without launching the web UIz--mcp-webuiztOverride Configuration > Agents MCP autostart for this launch; --mcp-webui enables it and --no-mcp-webui disables itz--mcp-transportz\MCP transport: stdio (default with --mcp), sse, or streamable-http (default with the web UI)z
--mcp-hostz*Optional MCP host for non-stdio transportsz
--mcp-portzUOverride the Agents configuration MCP server port for HTTP transports (default: 8000)z--mcp-api-version)Ú1Ú2ú2.1r6   zEWanGP MCP API version (latest: 2.1); pin 1 or 2 for earlier contractsz--mcp-asynczUAllow asynchronous generation/post-processing in MCP API v2/v2.1; disabled by defaultz--mcp-console-outputz5Mirror WanGP stdout/stderr while serving MCP requestsz--mcp-allow-read-file-systemzTAllow MCP agents to reference arbitrary server filesystem paths; disabled by defaultz	--dry-runz5Validate file without generating (use with --process)z--output-dirzAOverride output directory for CLI processing (use with --process)z--refresh-catalogz<Refresh local plugin metadata for installed external pluginsz--refresh-full-catalogz5Refresh local plugin metadata for all catalog pluginsz--merge-catalogzHMerge plugins_local.json into plugins.json and remove plugins_local.json)Úconfigure_llm_io)Úshared.deepy.configr   ÚlistÚsysr   ÚargparseÚArgumentParserÚadd_argumentÚfloatr
   r   ÚintÚBooleanOptionalActionÚSUPPRESSÚshared.authenticationr3   r   Ú
parse_argsÚllm_ioÚshared.llm_ior7   Ú	ask_deepyr   Úverbose)r   r   r   ÚparserÚaddr3   Úargsr7   s           r   Úparse_wgp_argsrK      s•	  € ØBÐBÐBÐBÐBÐBÝ  •”˜˜˜”�°$Ñ7Ô7€DÝÔ$Ð1lÐmÑmÔm€FØ
Ô
€Cà€Cˆ˜|Ð2dÐeÑeÔeÐeØ€CÐ ,ð  6Dð  Eñ  Eô  Eð  EØ€CÐ <Ð6[Ð\Ñ\Ô\Ð\Ø€Cˆ˜\Ð0JÐKÑKÔKÐKØ€CÐ#­%¸ð  ENð  Oñ  Oô  Oð  OØ€Cˆ	˜,Ð-_Ð`Ñ`Ô`Ð`Ø€Cˆ Ð3oÐpÑpÔpÐpØ€Cˆ˜|Ð2IÐJÑJÔJÐJØ€CÐ <Ð6eÐfÑfÔfÐfØ€Cˆ˜LÐ/uÐvÑvÔvÐvØ€Cˆ˜Ð,\Ð]Ñ]Ô]Ð]Ø€Cˆ�# sð  2Oð  Pñ  Pô  Pð  PØ€CÐ LÐ7lÐmÑmÔmÐmØ€Cˆ	� RÐ.VÐWÑWÔWÐWØ€CˆÕ.¸ÀFð  RHð  Iñ  Iô  Ið  IØ€Cˆ Ð3TÐUÑUÔUÐUØ€Cˆ�c¨2Ð4LÐMÑMÔMÐMØ€Cˆ�3¨
Ð9RÐSÑSÔSÐSØ€Cˆ
� bÐ/kÈOÐ/kÐ/kÐ/kÐlÑlÔlÐlØ€Cˆ�# r°Ð=Ñ=Ô=Ð=Ø€Cˆ�# q¨Ð?Ñ?Ô?Ð?Ø€Cˆ�c¨4Ð6{Ð|Ñ|Ô|Ð|Ø€CÐ¥S°"¸hð  NUð  Vñ  Vô  Vð  VØ€CÐ¥¨b¸(ð  Jvð  wñ  wô  wð  wØ€Cˆ
� b°(ð  BTð  Uñ  Uô  Uð  UØ€Cˆ	� QÐ-FÐGÑGÔGÐGØ€Cˆ
� aÐ.HÐIÑIÔIÐIØ€Cˆ•s BÐ-FÐGÑGÔGÐGØ€Cˆ˜\Ð0TÐUÑUÔUÐUØ€Cˆ˜Ð,NÐOÑOÔOÐOØ€Cˆ˜Ð,NÐOÑOÔOÐOØ€Cˆ�c¨1°=ÐAÑAÔAÐAØ€Cˆ	� R¨nÐ=Ñ=Ô=Ð=Ø€CÐ!­°qð  @Hð  Iñ  Iô  Ið  IØ€Cˆ�U¨A°xð  Ghð  iñ  iô  ið  iØ€Cˆ�E¨°BÀÈ8ð  [Sð  Tñ  Tô  Tð  TØ€CÐ I¨vÐ#6Àð  Lqð  rñ  rô  rð  rØ€CÐÐ$CÐ$CÐ$CÈTð  YBð  Cñ  Cô  Cð  CØ€CÐ$­XÔ-KÐUYð  aMð  Nñ  Nô  Nð  NØ€Cˆ�c¨2°MÐBÑBÔBÐBØ€Cˆ•c 2Ð,@ÐAÑAÔAÐAØ€CÐ °NÐCÑCÔCÐCà€Cˆ˜­8Ô+<Ð=Ñ=Ô=Ð=Ø€Cˆ˜­8Ô+<Ð=Ñ=Ô=Ð=Ø€Cˆ˜L­xÔ/@ÐAÑAÔAÐAØ€Cˆ˜\µÔ0AÐBÑBÔBÐBØ€Cˆ˜lµÔ1BÐCÑCÔCÐCØ€Cˆ˜\µÔ0AÐBÑBÔBÐBØ€Cˆ˜L­xÔ/@ÐAÑAÔAÐAØ€Cˆ˜LÐ/KÐLÑLÔLÐLØ€Cˆ
˜<Ð.RÐSÑSÔSÐSØ€Cˆ�C¨Ð2BÐCÑCÔCÐCØ€Cˆ�S¨"Ð3DÐEÑEÔEÐEØ€Cˆ�# rð  1Eð  Fñ  Fô  Fð  FØ€Cˆ˜Lð  0hð  iñ  iô  ið  iØ€CÐ Ð4tÐuÑuÔuÐuØ3Ð3Ð3Ð3Ð3Ð3Ø€M�&ÑÔÐØ€CÐ ¨$Ð5Sð  [Cð  Dñ  Dô  Dð  DØ€Cˆ˜lÐ1zÐ{Ñ{Ô{Ð{Ø€Cˆ˜Ð+fÐgÑgÔgÐgØ€Cˆ�hÔ<Àdð  RHð  Iñ  Iô  Ið  IØ€CÐ¥¨Rð  7Uð  Vñ  Vô  Vð  VØ€Cˆ�3¨Ð1]Ð^Ñ^Ô^Ð^Ø€Cˆ�;°ð  <Sð  Tñ  Tô  Tð  TØ€CÐÐ%6Àð  MTð  Uñ  Uô  Uð  UØ€Cˆ˜lð  2Ið  Jñ  Jô  Jð  JØ€CÐ |Ð:qÐrÑrÔrÐrØ€CÐ&¨|ð  CYð  Zñ  Zô  Zð  ZØ€Cˆ˜LÐ/fÐgÑgÔgÐgØ€Cˆ�S¨"Ð3vÐwÑwÔwÐwØ€CÐ LÐ7uÐvÑvÔvÐvØ€CÐ ¨Ð<sÐtÑtÔtÐtØ€CÐ ,Ð5ð  Añ  Aô  Að  Aà×Ò˜TÑ"Ô"€DØ„{ð &Ø2Ð2Ð2Ð2Ð2Ð2àÐ˜œÑ%Ô%Ð%Ø„~ð �m¨D°+Ñ>Ô>ð ØˆŒØ€Kr   )r   r   r	   r
   r   r   )N)r   r
   r   r   )Ú
__future__r   r;   r:   Úcollections.abcr   Úshared.lora_pathsr   Úshared.mcp.configr   r   rK   © r   r   ú<module>rQ      s¡   ðà "Ð "Ð "Ð "Ð "Ð "à €€€Ø 
€
€
€
Ø $Ð $Ð $Ð $Ð $Ð $à .Ð .Ð .Ð .Ð .Ð .Ø )Ð )Ð )Ð )Ð )Ð )ð[ð [ð [ð [ðYð Yð Yð Yð Yð Yð Yr   