§
    »yñjÇ  ã                  óX  — d Z ddlmZ ddlZddlZddlmZ  ee¦  «                             ¦   «         j	        d         Z
 ee
¦  «         ee
dz  ¦  «         ee
dz  ¦  «        gej        dd…<   ddlZddlZddlZdZd	Zdd„Zddd„Zdd„Zddd„Zedk    r e e¦   «         ¦  «        ‚dS )aÒ  Install Front + back: what builds a model from a front and a back picture.

    python scripts/bootstrap_front_back.py          # says what it wants, then asks
    python scripts/bootstrap_front_back.py --yes    # for the studio's Setup page and agents

- **Pixal3D's multi-view flows**, 5.9 GB, which build the shape from both pictures
  (`bootstrap_pixal3d.py --multiview`; the encoder and decoders are shared with the
  single-view set, so they are linked rather than fetched).
- **A picture engine that can draw the back.** FLUX.2 [klein] reads the front by itself, so
  with it nothing more is fetched. Qwen-Image needs its vision projector (0.75 GB), fetched
  here only when Qwen is the engine set up and the projector is missing.

Both build on routes that must already be set up, Pixal3D and a picture engine; this says so
and stops if either is missing. `AGENTS.md`: name the backend, the route and the size, and
ask. Nothing downloads without `--yes` or a typed yes.
é    )ÚannotationsN)ÚPathé   ÚscriptsÚviewerl   ô22: iÀ×,ÚreturnÚboolc                 ó¬   — t          d„ t          j                             ¦   «         D ¦   «         ¦  «        rdS t          j        t          j        ¦  «        S )zŒWhether the back can only be drawn once Qwen's vision projector is fetched: no engine
    can draw backs yet, and Qwen is the one installed.c              3  óf   K  — | ],}t          j        |¦  «        ot          j        |¦  «        V — Œ-d S ©N)Ú	image_apiÚis_installedÚcan_edit©Ú.0Úes     ú/G:\AssetFurnace\scripts\bootstrap_front_back.pyú	<genexpr>zneeds_vision.<locals>.<genexpr>(   s=   è è € Ð
cÐ
cÀ1�9Ô! !Ñ$Ô$Ð>­Ô);¸AÑ)>Ô)>Ð
cÐ
cÐ
cÐ
cÐ
cÐ
có    F)Úanyr   ÚENGINESÚvaluesr   ÚQWEN© r   r   Úneeds_visionr   %   sJ   € õ Ð
cÐ
cÍ	ÔHY×H`ÒH`ÑHbÔHbÐ
cÑ
cÔ
cÑcÔcð ØˆuÝÔ!¥)¤.Ñ1Ô1Ð1r   Úvisionúbool | NoneÚstrc           
     ó:  — | €t          ¦   «         n| } t          j        \  }}}t          | rt          ndz   }dddd| rdndz   ddt
          j        d›d	t
          j        › d
�dt
          j        j	        › d�g}| r | 
                    d|d›d|› d|› d�¦  «         |d|dz  d›d�ddt
          j                             dd¦  «        z   gz  }| r:| 
                    dt          j                             ¦   «         d         z   ¦  «         d                     |dgz   ¦  «        S )Nr   Ú zAbout to install Front + back:z(  backend: Pixal3D (raven38/pixal3d.cpp)z + Qwen-Image 2.1 edit modez>  route:   front + back (multi-view shape, drawn back picture)z  weights: z.1fz GB  Pixal3D multi-view flows (ú)z*             -> vendor/pixal3d-cpp/models/ú/z           z.2fz GB  z (z) -> Hugging Face cacheg    eÍÍAz
 GB in allz  licences: zpixal3d-sv-q8_0-v1zpixal3d-q8_0-v1z            Ú
)r   ÚqwenÚVISIONÚMV_BYTESÚVISION_BYTESÚpixal3dÚMV_GBÚMV_REPOÚ	MV_MODELSÚnameÚappendÚLICENCEÚreplaceÚ
splitlinesÚjoin)r   ÚrepoÚfilenameÚsizeÚtotalÚliness         r   Úannouncementr7   -   sX  € Ø%˜~�\‰^Œ^ˆ^°6€FÝœ;Ñ€Dˆ(�DÝ¨Ð5�˜°AÑ6€Eà
Ð,¨bØ2ÐW]Ð6eÐ6SÐ6SÐceÑfØHØZ•g”mÐZÐZÐZÍÌÐZÐZÐZØNµWÔ5FÔ5KÐNÐNÐNðP€Eð ð ]Ø�ŠÐ[ 4Ð[Ð[Ð[°(Ð[Ð[¸dÐ[Ð[Ð[Ñ\Ô\Ð\Ø	Ð7˜E C™KÐ7Ð7Ð7Ð7¸Ø�wœ×6Ò6Ð7KÐM^Ñ_Ô_Ñ_ðañ a€Eàð DØ�Š�^¥d¤l×&=Ò&=Ñ&?Ô&?ÀÔ&BÑBÑCÔCÐCØ�9Š9�U˜b˜T‘\Ñ"Ô"Ð"r   ú	list[str]c                 óN  — g } t          j        ¦   «                              ¦   «         rt           j                             ¦   «         s|                      d¦  «         t          d„ t          j         	                    ¦   «         D ¦   «         ¦  «        s|                      d¦  «         | S )z1What has to be set up before Front + back can be.z-Pixal3D (python scripts/bootstrap_pixal3d.py)c              3  ó>   K  — | ]}t          j        |¦  «        V — Œd S r   )r   r   r   s     r   r   z!missing_routes.<locals>.<genexpr>E   s-   è è € ÐMÐM¨Q�yÔ% aÑ(Ô(ÐMÐMÐMÐMÐMÐMr   z9a picture engine (python scripts/bootstrap_flux_image.py))
r(   Úcli_pathÚis_fileÚMODELSÚis_dirr-   r   r   r   r   )Úmissings    r   Úmissing_routesr@   @   s•   € à€GÝÔÑÔ×&Ò&Ñ(Ô(ð H­W¬^×-BÒ-BÑ-DÔ-Dð HØ�ŠÐFÑGÔGÐGÝÐMÐMµ)Ô2C×2JÒ2JÑ2LÔ2LÐMÑMÔMÑMÔMð TØ�ŠÐRÑSÔSÐSØ€Nr   Úargvúlist[str] | NoneÚintc                óð  — t          j        t          t           j        ¬¦  «        }|                     ddd¬¦  «         |                     | ¦  «        }t          ¦   «         }|r*t          dd                     |¦  «        z   dz   ¦  «         d	S t          ¦   «         }t          t          |¦  «        ¦  «         |j        s�t          j        rt          j                             ¦   «         st          d
¦  «         d	S t          d¦  «                             ¦   «                              ¦   «         dvrt          d¦  «         d	S t%          j        ¦   «          |rt)          j        ¦   «          t          d¦  «         dS )N)ÚdescriptionÚformatter_classz--yesÚ
store_truez5Skip the confirmation. For the studio and for agents.)ÚactionÚhelpz7Front + back builds on routes that are not set up yet: z; z). Set those up first. Nothing downloaded.r   z?Refusing to download without --yes when there is nobody to ask.zContinue? [y/N] >   ÚyÚyeszNothing downloaded.zN
Done. Create now builds characters and props from a front and a back picture.r   )ÚargparseÚArgumentParserÚ__doc__ÚRawDescriptionHelpFormatterÚadd_argumentÚ
parse_argsr@   Úprintr1   r   r7   rK   ÚsysÚstdinÚisattyÚinputÚstripÚlowerr(   Úinstall_multiviewr$   Úinstall_vision)rA   ÚparserÚargsr?   r   s        r   Úmainr]   J   s{  € ÝÔ$µÝ5=Ô5Yð[ñ [ô [€Fà
×Ò˜¨ØTð ñ Vô Vð Và×Ò˜TÑ"Ô"€DÝÑÔ€GØð ÝÐGÈ$Ï)Ê)ÐT[ÑJ\ÔJ\Ñ\Ø;ñ<ñ 	=ô 	=ð 	=àˆqÝ‰^Œ^€FÝ	�,�vÑ
Ô
ÑÔÐØŒ8ð ÝŒyð 	¥¤	× 0Ò 0Ñ 2Ô 2ð 	ÝÐSÑTÔTÐTØ�1ÝÐ#Ñ$Ô$×*Ò*Ñ,Ô,×2Ò2Ñ4Ô4¸LÐHÐHÝÐ'Ñ(Ô(Ð(Ø�1ÝÔÑÔÐØð ÝÔÑÔÐÝ	Ð
[Ñ\Ô\Ð\Øˆ1r   Ú__main__)r   r	   r   )r   r   r   r   )r   r8   )rA   rB   r   rC   )rN   Ú
__future__r   rL   rS   Úpathlibr   Ú__file__ÚresolveÚparentsÚREPOr   ÚpathÚbootstrap_pixal3dr(   Úbootstrap_qwen_imager$   r   r&   r'   r   r7   r@   r]   Ú__name__Ú
SystemExitr   r   r   ú<module>rj      sX  ððð ð" #Ð "Ð "Ð "Ð "Ð "à €€€Ø 
€
€
€
Ø Ð Ð Ð Ð Ð à€tˆH�~„~×ÒÑÔÔ'¨Ô*€Ø��D‘	”	˜3˜3˜t iÑ/Ñ0Ô0°#°#°d¸X±oÑ2FÔ2FÐG€„ˆˆ!ˆ�à #Ð #Ð #Ð #Ø #Ð #Ð #Ð #Ø Ð Ð Ð ð €Ø€ð2ð 2ð 2ð 2ð#ð #ð #ð #ð #ð&ð ð ð ðð ð ð ð ð6 ˆzÒÐØ
ˆ*�T�T‘V”VÑ
Ô
Ðð Ðr   