← back to Pattern Vault

whimsical-compare/daily/scripts/__pycache__/gen_daily.cpython-314.pyc

90 lines

+
�qNjl+���Rt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIt	^RI
t	]PP]PP]44t]PP]4t]P"P%RR4tRtRrRlt]!]!RR44t]!R]P0!R	44t]!]!R
]!]!]P!44R,444t]R]2t]P:!]R
R7Rt]!]PPAR44;_uu_4t!]PD!R]!PG44t$]$;'d]$PK^4tRRR4]'gQR4hRt&Rt'.RsOt(.RtOt).RuOt*RRRRRR.RvOR.RwO/RRRRRR.RxOR.RyO/RRRRR R.RzOR.R{O/R!RR"RR#R.R|ORR$R%./R&RR'RR(R.R}ORR)R*./R+RR,RR-R.R~OR.RO/R.RR/RR0R.R�ORR1R2./R3RR4RR5R.R�ORR6R7.//t+]!R8R94t,R�R:lt-R;t.R<t/.R�Ot0.R�Ot1R=t2]Pf!]4.t4R>t5^t6^t7]8!]44]8Ed�]6]^,8Ed�]6^,
t6],R?8H;'g"],R@8H;'d]P!4RA8t9]9'dt]Pt!];!]+44t<]+]<,t=]=R,t>]Pt!]=R,4t?]Pt!]=R,4t@RB]>RC]?RD]=R,RE]@RF2	tAMDR9t<]Pt!](4t>]Pt!])4t?]Pt!]*4t@RG]>RC]?RH]@RF2tA]]6^
,,t3]/!]A]34tB]BP%RI4;'g/P%RJ^4;'g^tC]5]C,
t5]BP%RK4RL8wd-]D!RM]6RN]BP%RK42]P�RO7EK�]BRP,tF]G!]F];4'd
]F^,M]FtH]P�RQRR4RS]8!]44^,RT
RU2tJ]RV]J2tK]	P�P�]H]K4].!]K4tN]O;QJdRWR�4F'gKR
M	RXM
!RWR�44'd1]P�!]K4]D!RM]6RY]NRZ2]P�RO7EK�]2!]>]?]8!]444tQ]4P�R[]8!]44^,R\]KR]]QR]>R^]?R_]@R`]<Ra]ARbRcRd]S!]C^4/
4]D!Re]8!]44RV]Rf]Q2]P�RO7]P�!Rg4EK]S!]5Rh,^4tURi]Rj]8!]44Rk]Rl]6Rm]URd]S!]5^4Rn]4/tV]P�!]V]!]Ro2Rp4^Rq7]D!]P�!]V44R# +'giELH;i)�u3
Generate N fresh, ORIGINAL, settlement-passed whimsical wallpaper designs for the
daily Spoonflower drop. Every design is our own invention (randomised style x motif
x palette lane) — never a copy of a marketplace design — and each output is
vision-checked for banned elements (bird/butterfly/banana/grape) before it counts.

Writes files to daily/runs/<date>/ and prints a JSON manifest to stdout.
$0 for the vision check (local qwen). Replicate SDXL is the only paid part (~1c/img).

Usage: python3 gen_daily.py --n 20 --date 2026-07-02 [--seed-base 1234]
N�
OLLAMA_URLzhttp://127.0.0.1:11434zqwen2.5vl:7bc�n�\PpW9dW"PV4^,,#T#)�)�sys�argv�index)�flag�d�as&& �scripts/gen_daily.pyrrs)�����A�!%��1�W�W�T�]�1�_��1��1�z--n�20z--datez%Y-%m-%dz--seed-basei@Bz/runs/T)�exist_okz~/Projects/secrets-manager/.envz$REPLICATE_API_TOKEN=([A-Za-z0-9_-]+)zno replicate tokenzBMozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36z�bird, birds, butterfly, butterflies, banana, bananas, banana leaves, banana pods, grape, grapes, grape clusters, text, watermark, signature, logo, blurry, low quality, jpeg artifacts, seams, mismatched edges, frame, border, vignettezArt-Deco Geometric�stylezart-deco geometric�desczbold graphic gilded and luxe�motifs�paletteszAnimal-Skin Printzanimal-skin printz*chic maximalist with a modern colour twistzTexture-Effectztextured wallcovering effectztactile tonal and sophisticated�Bohozartisanal boho block-printzearthy handcrafted and globalzterracotta, indigo, creamzrust, ochre, sandzPaisley / Nomadicznomadic paisleyz!intricate decorative and heritagezclaret, indigo, goldzplum, teal, creamz
Abstract Blurzabstract watercolorzsoft ethereal ombre and dreamyzRetro Geometriczretro mid-century geometricznostalgic bold and structuredzmustard, teal, creamzolive, rust, bonezMushroom / Goblincorezgoblincore woodlandzwhimsical cozy and folkloriczforest green, brown, creamzmoss, plum, ochrez--lanes�	whimsicalc��R\RR/pV'dVPV4Ve%\P!V4P	4MRp\
PPYYE'dRMRR7p\
PPWcR7;_uu_4p\P!V4uuRRR4# +'giR#;i)z
User-AgentzContent-Typezapplication/jsonN�POST�GET)�data�headers�method��timeout)
�UA�update�json�dumps�encode�urllib�request�Request�urlopen�load)�url�payloadrr�hdrr�req�rs&&&&    r�	http_jsonr,[s�����^�-?�
@�C���
�
�7�#�+2�+>�4�:�:�g��%�%�'�D�D�
�.�.�
 �
 ���t�V�Y^�
 �
_�C�	���	�	��	�	5�	5���y�y��|�
6�	5�	5�	5�s�!C�C	c���\P!\VR4P44P	4p\\R2R\RRRV.RRRR	R
//^xR7p\P!\P!RVPR
R4\P4P^44pRUu/uFqD\VPV44bK	up#uupi \ d/u#i;i)�rbz
/api/generate�model�promptulReply ONLY JSON {"bird":bool,"butterfly":bool,"banana":bool,"grape":bool} — true only if clearly depicted.�images�streamF�options�temperatureg�������?rz\{.*\}�response���bird�	butterfly�banana�grape)�base64�	b64encode�open�read�decoder,�OLLAMA�VMODELr�loads�re�search�get�S�group�bool�	Exception)�img_path�b64�out�j�ks&    r�check_outputrPcs���
�
�
�4��$�/�4�4�6�
7�
>�
>�
@�C���6�(�-�0��V��E��s�e�X�u�i�-��9M�3O�Y\�]��
�J�J�r�y�y��C�G�G�J��,C�R�T�T�J�P�P�QR�S�T��+S�T�+S�a�4����a��>�!�+S�T�T��T�����	��s$�BC,�#C'�$C,�'C,�,
C<�;C<c�v�\RRR\2/R7R,R,p\RRVRR	VR
\RRR
RR^RRRVRR//RR\2/R7p\^Z4FVpVP	R4R9dV#\
P!^4\VR,R,RR\2/R7pKX	V#)z5https://api.replicate.com/v1/models/stability-ai/sdxl�
AuthorizationzBearer )r�latest_version�idz(https://api.replicate.com/v1/predictions�version�inputr0�negative_prompt�widthi�height�num_inference_steps�guidance_scaleg@�seed�refine�
no_refiner�status�urlsrF)�	succeeded�failed�canceled)r,�tok�NEG�rangerF�time�sleep)r0r\�ver�pred�_s&&   r�sdxlrlos���
�K�,���u�o�>�@�@P�R�RV�X�C��?��3��(�F�4E�s�G�UY�[c�ei��r�#3�S�&�$��R^�"`�Ba�!�G�C�5�/�2�4�D��2�Y���8�8�H��!D�D�e��K�	
�
�
�1�
���f��e�,��'�RU�QV��6X�Y����Krc��\P!\V^,,4\P!\4R\P!\
4RVP
R4^,P42#)�� u — z and )�randomr\�	SEED_BASE�choice�ADJ�NOUN�split�title)r�motif�is&&&rrvrv�s[��
�K�K�	�A��E�!�"��m�m�C� �
!��6�=�=��#6�"7�u�U�[�[��=Q�RS�=T�=Z�=Z�=\�<]�^�^rg�trending�bothg�?z	Original z wallpaper: z, z�, our own artistic invention, not a copy of any existing design. seamless repeating wallpaper pattern, tileable, flat lay, even lighting, high-end wallcovering. Colorway: �.zOriginal hand-illustrated z�, whimsical and charming, playful naive hand-drawn linework, our own artistic invention, not a copy of any existing design. seamless repeating wallpaper pattern, tileable, flat lay, even lighting, high-end wallcovering. Colorway: �metrics�predict_timer_raz	[attempt z] gen )�file�output�-r6rk�02dz.png�/c#�L"�TFp\PV4x�K	R#5i�N)�chkrF)�.0rOs& r�	<genexpr>r��s���
H�G�!�3�7�7�1�:�:�G�s�"$Fz] SETTLEMENT BLOCK u — discarded, retrying�nr~rvrw�palette�laner0�
settlement�OK�predict_secs�[z] g333333�?g�����G?�date�count�	requested�attempts�est_cost_usd�designsz/manifest.json�w)�indentr�)
�cottagecorezmid-century modernzfolk block-print�scandinavianzart-nouveau linezwatercolor storybookz
gouache naivezhand-cut paper collagezditsy calicozwhimsical geometric)ztiny mushrooms and toadstoolsz scattered wildflowers and sprigszrolling hills and cottageszcurling ferns and leaveszsmiling suns and moonszlittle teapots and cupszgarden snails and pebbleszstar and cloud confettizcitrus slices and dotszrainbows and raindropszsailboats and waveszcats curled in flowerszhot air balloonszacorns and oak leaveszabstract squiggles and blobszpolka-dot toadstool ringszmeadow foxgloveszquilted patchwork hearts)
zsage, cream, terracottazdusty blue, ochre, ivoryzblush pink, sand, olivezmustard, teal, oatmealzlilac, moss, butterzcoral, denim, chalkzforest green, rust, bonezpeach, mint, taupeznavy, marigold, linenzplum, sage, apricot)zfan and sunburst motifszstepped chevron zigzagszscalloped shell arcszmetallic linear grid)zchartreuse, black, goldzemerald, brass, creamznavy, gold, black)z
cheetah spotsz
tiger stripesz
zebra stripeszleopard rosetteszsnakeskin scales)zrose blush, cream, charcoalzverdant green, blackzclaret, sand, ink)zgrasscloth woven texturezlinen weave texturezplaster limewash textureztweed fabric texture)zgreige, oatmeal, stonezmushroom, creamzsage, taupe)zblock-print medallionszfolk geometric borderszmudcloth markszkilim diamonds)zkashmiri paisley botehzpersian teardrop paisleyzmandala medallions)zombre gradient washeszinky bleed markszmarbled fluid swirlszsoft-focus colour drifts)zblush, taupe, greyzdusty blue, ivoryz
sage, sand)zinterlocking semicircleszatomic starburstszmod circle gridsztotem shapes)zmushroom clusters and fernsztoadstool rings and mosszsnails and pebbles among fungi)NN�)�Meadow�Cottage�Hollow�Thicket�Wren�Bramble�Fern�Marigold�Juniper�Poppy�Willow�Clover�Sorrel�Heath�Larkspur�Nettle�Foxglove�Hazel�Rowan�Sage)
�Whimsy�Ramble�Frolic�Wander�Reverie�Lullaby�Trellis�Gambol�Ditty�Winkr7)Y�__doc__�osrDrrgrr<rp�urllib.requestr"�urllib.error�path�dirname�abspath�__file__�HERE�DAILY�environrFrArBr�int�N�strftime�DATE�strrq�OUT�makedirsrdr>�
expanduser�frEr?�mrHrre�STYLES�MOTIFS�PALETTES�TREND_LANES�LANESr,rPrlrsrtrvr\r��
total_secsr�rx�len�	use_trendrr�list�
lane_label�Lrrwr�r0rj�secs�print�stderrrM�
isinstance�imgurl�replace�fn�destr#�urlretriever��any�remove�t�append�roundrh�cost�manifest�dumpr �rr�<module>r�sR��
�M�L�L�L�L�	�w�w���r�w�w���x�0�1��
��������	������&>�	?��	��2���U�D�����H�d�m�m�J�/�0����]�C��D�I�I�K�(8�7�(B�$C�D�E�	�	��v�d�V������C�$��
��	�"�'�'�
�
�>�
?�@�@�A�
�	�	�9�1�6�6�8�D�A�
�
�
�����
�C�A�� � � �s�I��3��

t��
W��#���W�&:�F�Db��x��]�_��W�&9�6�Co��m��`�b��W�&D�f�No��y��P�R��W�&B�F�Lk��j��0�2E�F�H��W�&7��Ad��^��+�-@�A�C��W�&;�V�Ee��s��M�O��W�&C�V�Ml��g��+�-@�A�C��W�&;�V�Ec��o��1�3F�G�I�-��6	
�Y��$���
��j��k��_����I��
��
�
�����	�'�l�Q��8�a�!�e�+���M�H���#�R�R����(Q�(Q�F�M�M�O�c�<Q�I���]�]�4��#4�5�
�;�z�;R�q��'�
��F�M�M�!�H�+�$>�E�&�-�-�XY�Zd�Xe�Jf���e�W�L���r�!�F�)��EO�OV�i�WX�Z��!�
��
�
�f�%��v�}�}�V�/D�u�PV�P]�P]�^f�Pg�g�.�u�g�\�%��I� '�i�q�*���x�"�}�$�D�����D��H�H�Y��%�%�2�*�*�>�1�=�B�B��D��$��J��x�x���[�(�
�	�(��6�$�(�(�8�*<�)=�>�S�Z�Z�P�RZ�
�x�.�C�Z��T�-B�-B�3�q�6��&��L�L��R� �!��3�w�<��>�#�"6�d�	;�B��U�!�B�4�=�D�
�N�N���v�t�,�
�t�
�C�
�
H�G�
H�s�s�s�
H�G�
H�H�H�
�	�	�$��
�	�(��#6�s�e�;S�T�[^�[e�[e�f��
�e�U�C��L�)�A��N�N�C��W��a����w��7�E��U�I�w��
�H�V\� �$���d�A��H�I�
�A�c�'�l�^�1�Q�C�r�!��
%�C�J�J�7��J�J�s�O��Z�(�
"�A�&���D�'�3�w�<��a��X��D�.�%�
�A�2F�	�SZ�\���	�	�(�D�C�5��/��5�a�@��d�j�j����kA�@�@�s�8=V4�4W