見出し画像

PaperspaceでComfyUI+Flux.1を動かした作業ログ

きっかけ

最近Xなどで Flux.1の話を聞くようになり、試してみたくなりました。僕はPaperespaceを使っているので、そこで動かす方法をググったところ、shiba*2さんの記事がヒットしました。shiba*2さん、ありがとうございます!

まず ComfyUIをPaperspace上にインストールしなければ、と同様に調べると、neneさんの記事がヒットしました。

neneさんの記事によると、Paperspaceのブログで導入方法の紹介があり、その手順が記載されています。neneさんありがとうございます!

ComfyUIの起動まで

PaperspaceでProject作成→notebook作成

新規にProjectを作成します。

Create a new project

Projectができました。新しいnotebookを作ります。

新しい Project

Select a template で、「Start from Scratch」を選びます。

Select a template

Select a machine では、その時に表示されていた Free-P5000 を選択

Select a machine

自動シャットダウンは 6Hにして、START NOTEBOOK します。

ComfyUIの起動

neneさんの手順を参照ください。結果は以下です。

①レポジトリの取得

root@nbuje2xigc:/notebooks# echo "[Terminal 1]"
[Terminal 1]
root@nbuje2xigc:/notebooks# git clone https://github.com/TheLastBen/PPS.git
Cloning into 'PPS'...
remote: Enumerating objects: 177, done.
remote: Counting objects: 100% (94/94), done.
remote: Compressing objects: 100% (93/93), done.
remote: Total 177 (delta 58), reused 1 (delta 0), pack-reused 83
Receiving objects: 100% (177/177), 55.81 KiB | 1.09 MiB/s, done.
Resolving deltas: 100% (107/107), done.
root@nbuje2xigc:/notebooks# 

②画面上の各Runを実行

PPS-ComfyUI.ipynb 画面
Dependencies
Install/Update ComfyUI
Model Download/Load
LoRA Download
ControlNet
Start ComgyUI
Startting server

ComfyUI画面起動

ComgyUI

画像生成してみる

モデルをアップロードします。モデルは BDさんの BD_pony_Real_V03 です(有料)。
アップロード場所は  /notebooks/ComfyUI/models/checkpoints です。

sdxl_vae.safetensors は   /notebooks/ComfyUI/models/vae にアップしました。が、ワークフロー上は表示されていないような、、

Load Checkpoint や、positive prompt, negative prompt,  など入力して [Queue Prompt] を実行してみます。

Queue Prompt

画像を作ってはいますが、出来上がりがおかしい、、、

そこで、上の neneさんの記事で紹介されていた、ANIMAGINE XL を入れてみます。

すると、以下のように画像が生成されました。パラメータはEmpty Latent Image を 1024 x 1024 に変えただけです。

ANIMAGINE XL

一応動いていますが、まだ詳細は不明です。
Flux.1 の導入を通じて、確認します。

Flux.1の導入と試行

shiba*2 さんの手順に従って実施しました。大本の手順は以下にあります。

①For Flux schnell you can get the checkpoint here that you can put in your: ComfyUI/models/checkpoints/ directory.

②You can then load or drag the following image in ComfyUI to get the workflow:

workflowのpng

①checkpointをダウンロードして配置

root@xxxxxxxxxx:/notebooks/ComfyUI/models/checkpoints# curl --progress-bar -L -o flux1-schnell-fp8.safetensors https://huggingface.co/Comfy-Org/flux1-schnell/resolve/main/flux1-schnell-fp8.safetensors?download=true
############################################################################################################################# 100.0%############################################################################################################################# 100.0%
root@xxxxxxxxxx:/notebooks/ComfyUI/models/checkpoints# 

②workflowのpngをLoad(png画像をロードすることは知りませんでした)

ComgyUI起動後の画面

Load後↓

Load後

画像生成↓

画像生成

元の画像が生成されました。
shiba*2さんと同じプロンプトで、何枚か生成しました。shiba*2さんもおっしゃっていますが、期待する画像を出すにはある程度ガチャするようです。

別のプロンプトを試してみます。
A stylish 22-year-old beautiful woman in Tokyo, wearing a cropped white top with a slight texture, paired with a high-waisted, light blue denim mini skirt. She completes the outfit with strappy black sandals that have a slight heel. On her wrist, she wears a delicate charm bracelet with small, playful charms. The overall look is fresh, youthful, and perfect for a sunny summer day.

以下のような画像がでました。再現性は高い感じです。

さらに試してみます。
A high school beautiful girl working a part-time job as a cashier in a convenience store during summer vacation. She is standing at the clean and organized counter, wearing the store's uniform: a short-sleeve blue polo shirt, black pants, and a dark apron. Her hair is tied back in a ponytail, and she has a bright smile.

In the scene, she is scanning a bottle of water with a handheld barcode scanner, which is black in color. The counter includes a cash register, a display showing the scanned item, and a receipt printer. Behind her, shelves are stocked with various drinks and snacks, all neatly arranged. The store is brightly lit with a cool, air-conditioned atmosphere.

The customer has placed the bottle on the counter, and the girl is in the process of scanning it. She holds the bottle in one hand and the scanner in the other. The interaction is friendly and efficient, showcasing her professionalism and cheerful attitude.

結果です↓ コンピにのレジの様子がかなり再現されています。さすがですね。

面白くなってきたので、他にも試します。
A 22-year-old beautiful female dental assistant wearing a clean white scrub top and mint green scrub pants, with her hair neatly tied back. She is assisting a patient seated in a dentist's chair, adjusting the chair's angle with a gentle smile. She is holding a small dental mirror in one hand, carefully inspecting the patient's teeth under the bright overhead light. The scene exudes professionalism and calmness, with the dental office in the background, featuring modern equipment and soft, neutral colors.
↓歯科医院の様子がでていますね。細かいところは変ですが、、

A young female nurse, 22 years old, wearing a soft pink scrub top and matching pants, is in a medical examination room during a health checkup. Her shoulder-length black hair is neatly tied back into a simple ponytail. She is standing beside a seated patient, carefully measuring their blood pressure using a manual sphygmomanometer. The nurse has a focused yet gentle expression, her eyes fixed on the gauge as she listens to the stethoscope placed on the patient’s arm. The room is bright and clean, with medical equipment neatly organized on nearby shelves. The patient is seated comfortably in a chair, their arm extended on a small table for the blood pressure measurement. The nurse’s calm and professional demeanor creates a reassuring atmosphere as she performs her task with precision and care.
↓こちらは失敗も多かったですが、血圧を測っているようすが出ています。

A slender Japanese woman in her 20s with black hair elegantly descends from the seat of a chauffeured luxury car as the door opens. She is dressed in a charming pastel pink knee-length dress with a flared hemline, which beautifully accentuates her slim figure and adds a playful, yet elegant touch. The dress features delicate lace detailing and a ribbon accentuating her waist, enhancing her feminine charm while creating a flattering silhouette.

She pairs the dress with nude-colored high heels, which complement the outfit and elongate her already slender legs, creating a harmonious and refined look. She wears sheer nude stockings, adding a layer of sophistication and ensuring a seamless transition from her dress to her shoes. Her black hair is styled in a loose half-updo with soft curls framing her face, contributing to her overall graceful appearance.

For accessories, she opts for a pearl necklace and small diamond earrings, providing just the right amount of sparkle without overwhelming her delicate features. She completes her ensemble with a small clutch bag in a matching pastel shade, maintaining consistency in her color palette. As she gracefully steps out of the luxury car and moves elegantly towards the wedding venue, her dress coordination strikes the perfect balance between modern elegance and timeless femininity, making her a standout guest at the celebration.

以前、ChatGPTで作った長文のプロンプトがそのまま再現されるので面白いです。
きりがないのでこの辺で止めておきます。

この記事が気に入ったらサポートをしてみませんか?