## 這兩個禮拜爆紅的 Stable Diffusion

Stable DiffusionStability AI 訓練出來的 model，跟之前提到的 DALL-E 最大的差異就是產生出的圖的限制少很多：

Unlike competing models like DALL-E, Stable Diffusion is open source and does not artificially limit the images it produces, though the license prohibits certain harmful use cases.

Simon Willison 的「Stable Diffusion is a really big deal」這篇來當作總覽還不錯。

## 用 DALL·E 2 的圖當作網誌文章的圖片

I spent the weekend and \$45 in OpenAi credits generating new thumbnails that better represent the content of all 100+ posts from our blog.

## 玩玩文字轉圖片的 min(DALL·E)

```#!/usr/bin/env python3

from min_dalle import MinDalle
import torch

model = MinDalle(
models_root='./pretrained',
dtype=torch.float32,
device='cpu',
is_mega=True,
is_reusable=False,
)

images = model.generate_image(
text='Nuclear explosion broccoli',
seed=-1,
grid_size=2,
is_seamless=False,
temperature=1,
top_k=256,
supercondition_factor=32,
is_verbose=False,
)

images = images.save('test.png')```

## 圖片無損壓縮下的演算法比較

Hacker News 上看到「What’s the best lossless image format? Comparing PNG, WebP, AVIF, and JPEG XL」這篇，在講圖片的無損壓縮演算法。在 Hacker News 上的討論也可以看看：「What’s the best lossless image format? (siipo.la)」。

What I ended up with was downloading a set of images from Dribbble, a portfolio site for designers.

## 用 Poetry 的相依性演算法解數獨 (Sudoku)

Daily Lobsters 上看到「Solving Sudoku with Poetry's dependency resolver」這篇完全是惡搞 PythonPoetry 套件 XDDD

```[tool.poetry.dependencies]
python = "^3.6"
sudoku-cell11 = "*"
sudoku-cell12 = "2.0.0"
sudoku-cell13 = "*"
sudoku-cell14 = "8.0.0"
sudoku-cell15 = "*"
sudoku-cell16 = "9.0.0"
sudoku-cell17 = "*"
sudoku-cell18 = "*"
sudoku-cell19 = "*"
sudoku-cell21 = "3.0.0"
sudoku-cell22 = "7.0.0"
sudoku-cell23 = "*"
sudoku-cell24 = "6.0.0"
...
```

## 搞爆 Python 的各種姿勢

Hacker News 首頁上看到「no-op statements syntactically valid only since Python X.Y」這個專案，搞爆各個版本 Python 的各種方式，從 Python 2.4+ 一路到 3.11+ (不過中間有少了 3.2 與 3.4)。

This is a collection of no-op statements that are syntactically valid only since Python X.Y, for most X.Y ≥ 2.4.

`(0 for x in [])  # Python >= 2.4 is required`

`0_0  # Python >= 3.6 is required`

## V7Labs 提供的 Chrome Extension，偵測圖片是否為人工智慧生成的

Right-click on a profile picture, our model will detect if that image contains a GAN generated or real person!