??
??? “Stable Diffusion? ???? ???? MacBook(M2)?? FLUX.1 ???([dev]/[schnell]) ?? AI ?? ??”??? ??? ??? ? ?? ????. Stable Diffusion ????? ??? Black Forest Labs? FLUX.1 ??? ?? ??? ??????.
? ?? ?? ??, FLUX 1.1 [pro](??? Blueberry)? ? API? ?? ?? ???? ?? ?????? ?? ?? ?????.
?? ??? ?? BFL API? ?? ??? ?? ?? ???? ???? ??? FLUX1.1 [pro]? ?????. ?? ???? ?? ??? ??? ?? ??? ?? ???, ??? ? ??? ??? ????? ??? ???? ??? ??? ??????.
??: FLUX1.1 [pro] ? BFL API ?? - Black Forest Labs
?? ?????? FLUX 1.1 [pro] ? API
???? ????????.?? ?? ??? Python?? ???????.
?? ? API ? ??
?? ??? ???? API ???? ?? ???? ??????.
??? ??? ?? $0.01?? ?? ? 50???? ?????(??? ? ??).
?? ??? ?? ?? ??? ??? ????.
- FLUX 1.1 [pro]: ???? $0.04
- FLUX.1 [??]: ???? $0.05
- FLUX.1 [dev]: ???? $0.025
???? ? ? ??? ???? ??? ??? ???? API ?? ?????.
?? ??? ?? ?? ?????.
????
?? ??? macOS 14 Sonoma? ???? ????.
Python ??? ??? ????.
$ python --version Python 3.12.2
?? ??? ???? ?? ??? ??????.
$ pip install requests
??? ??? ??????:
$ pip list | grep -e requests requests 2.31.0
????? ???? ?? zshrc ??? ???? API ?? ?? ??? ??????.
$ open ~/.zshrc
?? ?? ??? BFL_API_KEY:
? ??????.
export BFL_API_KEY=<Your API Key Here>
?? ??
??? ? ?? ?? ??? ??? ????? ?? ?????. ?????? ??? ???? ??? ???? ??? ???? ?? ???? ?? ??? ?????.
import os import requests import time # Request request = requests.post( 'https://api.bfl.ml/v1/flux-pro-1.1', headers={ 'accept': 'application/json', 'x-key': os.environ.get("BFL_API_KEY"), 'Content-Type': 'application/json', }, json={ 'prompt': 'A cat on its back legs running like a human is holding a big silver fish with its arms. The cat is running away from the shop owner and has a panicked look on his face. The scene is situated in a crowded market.', 'width': 1024, 'height': 768, }, ).json() print(request) request_id = request["id"] # Wait for completion while True: time.sleep(0.5) result = requests.get( 'https://api.bfl.ml/v1/get_result', headers={ 'accept': 'application/json', 'x-key': os.environ.get("BFL_API_KEY"), }, params={ 'id': request_id, }, ).json() if result["status"] == "Ready": print(f"Result: {result['result']['sample']}") break else: print(f"Status: {result['status']}")
? ??? ????? ??? ????.
???? ???? ??? ???? ??? ?? ???? ?? ?? ????. ???? ?? ????? ???? ??? ??? ????. ??? ???? ??? ??? ???? ????.
?? ?? ??? ??? ????. ???? ?? API? ?? ?? ??? ?????.
$ python --version Python 3.12.2
???? ??? ?? bflapistorage.blob.core.windows.net?? ?????? ??? ???? URL? ???? ????.
??? ???? ??? ????.
??? ????? ???? ???? ???? ??????.
?? ???? ??
??? ???? ???? ?? ??? ????? ??????.
?? ?? ???
????: ????? ???? ???? "?? ?? ???"? ?????.
$ pip install requests
?? ?? ?????? ??
????: "?? ?? ?????? ???? ??"? ????? ???? ?????.
$ pip list | grep -e requests requests 2.31.0
????? ? ?? ????
????: ????? ???? ???? "???? ?? ?? ????".
$ open ~/.zshrc
??? ?? ??
????: ??? ?? ???? ???? "??? ?? ??".
export BFL_API_KEY=<Your API Key Here>
?? ??? ?? ?? ??? ??
????: ?? ???? ???? "?? ??? ?? ??? ??"? ?????.
import os import requests import time # Request request = requests.post( 'https://api.bfl.ml/v1/flux-pro-1.1', headers={ 'accept': 'application/json', 'x-key': os.environ.get("BFL_API_KEY"), 'Content-Type': 'application/json', }, json={ 'prompt': 'A cat on its back legs running like a human is holding a big silver fish with its arms. The cat is running away from the shop owner and has a panicked look on his face. The scene is situated in a crowded market.', 'width': 1024, 'height': 768, }, ).json() print(request) request_id = request["id"] # Wait for completion while True: time.sleep(0.5) result = requests.get( 'https://api.bfl.ml/v1/get_result', headers={ 'accept': 'application/json', 'x-key': os.environ.get("BFL_API_KEY"), }, params={ 'id': request_id, }, ).json() if result["status"] == "Ready": print(f"Result: {result['result']['sample']}") break else: print(f"Status: {result['status']}")
?? ????? 28? ?? ??
????: ?? ???? ???? "?? ????? 28? ?? ?? ??".
$ python --version Python 3.12.2
1980?? ?? ????
????: ?? ???? ???? "1980?? ?? ??".
$ pip install requests
2020? ??? ????
????: ?? ???? ???? "2020? ??? ????".
$ pip list | grep -e requests requests 2.31.0
??? ???? ?? ??? ??????.
??? AI ???? ?? ?? ???? ?? ??? ?? ?????? ?????.
??
Black Forest Labs? AI ??? ????? ???? ???? ????.
?? ??? ??? ?? ??? ?????.
??? ?? ??
Stable Diffusion? ??? AI ??? ??? ?? FLUX 1.1 [pro]? Web APIを呼ん?? ?? ???? ????? ??????
? ??? FLUX? ? API ?? [pro]: Stable Diffusion ??? ?? ??? ?? AI ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











Python? Unittest ? Pytest? ??? ? ???? ??, ?? ? ??? ????? ? ?? ?? ???? ??? ??? ?????. 1. ??? ??? ?? ??? ???? ??? ??? ??? ?????. UnitTest? ??? ??? ???? ???? Test \ _? ???? ???? ?????. Pytest? ? ?????. Test \ _?? ???? ?? ? ??????. 2. ??? ?? ?? ? ?? ? ??? ??? ????. UnitTest? Assertequal, AssertTrue ? ?? ??? ???? ?? Pytest? ??? Assert ?? ???? ?? ?? ??? ???? ?????. 3. ?? ??? ?? ? ?? ????? ????? ????.

pythonisidealfordataanalysisduetonumpyandpandas.1) numpyexcelsatnumericalcomputationsfast, multi-dimensionalArraysandectorizedOferationsLikenp.sqrt ()

?? ????? (DP)? ??? ??? ? ??? ?? ??? ??? ??? ? ??? ??? ?? ??? ???? ??? ????? ??????. ? ?? ?? ??? ????. 1. ??? (??) : ??? ?? ??? ???? ??? ???? ?? ??? ??????. 2. ??? (?) : ?? ???? ???? ????? ?????. ???? ???, ?? ?? ?? ?? ??/?? ?, ??? ??? ?? ?? ?? ??? ??? ????? ?????. ?????? ????? ?? ???? ?? ??? ? ???, ?? ??? ???? ?? ?? ??? ???? ??? ???? ????? ???? ???????.

??? ?? ???? ????? ????? __iter_ ? __next__ ???? ???????. ① __iter__ ???? ??? ? ?? ??? ???? ??? ?? ?? ??? ?????. ② __next__ ???? ? ??? ?? ????, ?? ??? ??? ????, ? ?? ??? ??? stopiteration ??? ??????. status ??? ???? ??????? ?? ??? ??? ?? ?? ??? ???????. pile ?? ?? ???? ?? ??? ?? ? ??? ?? ? ??? ?????? ?????. simple ??? ??? ?? ?? ??? ?? ???? ???? ?? ??? ? ??? ?? ????? ???? ??? ??? ???????.

Python? ?? ???? ?? ???, ?? ?? ????, ?? ???? ?? ? AI/ML ??? ???? ??? ?????. ??, Cpython? ???? ????? ?? ??, ?? ?? ??? ? ?? ? ?? ??? ?? ??? ??????. ??, ??? ????? ?? ?? ? ?? ??? ????? ?? ?? ? ? ??? ?? ?????. ??, Pyscript ? Nuitka? ?? ?? ???? ??? ??? ?? ??? ?????. ?????, AI ? ??? ?? ??? ?? ???? ??? ?? ???????? ???? ?? ? ??? ?????. ??? ??? Python? ??? ??? ????? ???? ?? ??? ???? ??? ?????.

Python? ?? ??? ???? ?????? ????, ????? ? ?? ??????? ???? ? ??? ??? ???? ?? ??? ?????. ?? TCP ??? ????? Socket.Socket ()? ???? ??? ??? ?? ? ??? ????? .listen ()? ???? ??? ?? .accept ()? ?? ????? ??? ???????. TCP ?????? ????? ?? ??? ??? ??? ????? .connect ()? ?? ? ?? .sendall ()? ???? ???? ??? .recv ()? ?? ??? ??????. ?? ?????? ????? 1. ??? : ??? ??? ? ???? ??? ? ????. 2. ??? I/O : ?? ??, Asyncio ?????? ? ??? ??? ?? ? ? ????. ???? ? ?

???? Python ?? ?? ?????? ?? ????, "??? ?????, ?? ??"? ???? ??? ??? ??? ?? ??? ?????. 1. ???? ?? ? ??? ?? ?????. ?? ???? ?? ??? ???? ??? ? ? ????. ?? ??, Spoke () ?? ???? ??? ??? ?? ??? ?? ????? ?? ??? ??? ????. 2. ???? ?? ???? ??? ??? ?????? Draw () ???? ???? ????? ?? ???? ?? ??? ???? ??? ???? ?? ?? ?? ??? ????? ?? ?? ????? ?? ?????. 3. Python ?? ???? ???????. ?? ???? ??? ???? ?? ???? ??? ????? ??? ?? ???? ??? ???? ????. ??? ??? ??? ???? ? ??? "?? ??"??????. 4. ???? ? ???? ?? ??? ?????

Python List ????? ?? ?? ??? [Start : End : Step] ??? ????? ??? ???? ????. 1. ?? ????? ?? ??? ?? [start : end : step]???. ??? ?? ??? (??), ?? ? ??? (???? ??)?? ??? ?? ?????. 2. ????? ???? 0?? ????? ???? ????? ??? ??? ???? ????? ??? 1? ??????. 3. my_list [: n]? ???? ? ?? n ??? ?? my_list [-n :]? ???? ??? n ??? ????. 4. My_List [:: 2]? ?? ??? ?? ?? ??? ???? ??? ??? ?? ?? ?? ??? ???? ? ????. 5. ???? ???? ? ???? ???? ????
