0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

FLUX.1で遊ぶ 拡張 120秒版を作る!

Last updated at Posted at 2024-08-07

有料のZeroGPUのメリットの一つが、他のZeroGPUを気軽にprivateで改造して試せるところですね。
同じ構成なので、ボタンひとつで、duplicateできます。Gradio編集が泣けるのと、使えるGPU時間は物凄く短いのでテストしにくいですが

image.png

デモ

FLUX.1 拡張 120秒版
https://huggingface.co/spaces/Akjava/FLUX.1-schnell-120sec

120秒あるからといって、必ず成功するわけではありません。サイズ 512x512ぐらいから試してみてください。(あと、時間以外も公式版からコード多少いじってます。)

今のところ、問題のある画像を一切生成しないので信頼感があります。

ローカルで動かす

1536x1536までなら、16GBの環境で動きました。

ただし、メモリ使用量を抑えるには以下は必須です。生成時間が200秒以上かかります。(ZeroGPUって相当スペック高いのでは?と見直してきました。)

pipe.enable_sequential_cpu_offload()

あとは、requirements.txt の編集が必要です。(ただ環境によっては、from torch._C importが解決できないかも。私もあきらめました)

git+https://github.com/huggingface/diffusers.git
protobuf

ちなみに、CPUでも動くけど、1000秒以上かかります。

環境は、condaです。どこかで見つけて、そのまま使っております。(rdkitはいるのかな?)

!wget -c https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
!chmod +x Miniconda3-latest-Linux-x86_64.sh
!bash ./Miniconda3-latest-Linux-x86_64.sh -b -f -p /usr/local
!conda install -q -y -c conda-forge rdkit python=3.10
import sys
sys.path.append('/usr/local/lib/python3.10/site-packages')
!conda init
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?