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?

同じロゴが大変身!?プレート風・ワッペン風・なぜか木目だけ迷子

Posted at

はじめに

Stable Diffusion XL と IP-Adapterを組み合わせると、1枚のロゴ画像をベースに「質感」を差し替える遊びができます。
今回は、同じシンプルな家マークのロゴを使い、金属・木目・布の3種類に変化させてみました。


実験結果

🔩 金属
logo_metal_v2.png
・光沢と反射のグラデーションが出て、銀色プレート風に。

・硬質な雰囲気がしっかり出ており、金属の質感としては成功。

🌳 木目
image.png

・木目を強くすると形が崩れ、弱めだと白ロゴのまま。

・「木材ロゴ」はAIにとって難しい例だった。

🧵布
image.png

・ロゴ全体が刺繍風になり、糸のギザギザが見える。

・ワッペンや刺繍ロゴをイメージさせる表現ができた。


【考察】

・形は残るが文字は崩れる → 文字部分は後から画像編集ソフトで加えるのが実務的。

・金属は成功率が高い(光沢や反射が出やすい)。

・木目と布は強度調整が重要 → strength を0.6前後にして形保持しつつ質感を乗せるのがベスト。

【おすすめ用途】

・ロゴやアイコンを「素材サンプル化」して提案資料に載せる

・ゲームやブランドの世界観演出(木札版ロゴ、金属プレート版ロゴなど)

・ワッペンやグッズ試作のイメージ生成


手順

環境セットアップ(Colab)

# ライブラリ
!pip -q install diffusers==0.30.0 transformers accelerate safetensors pillow

import torch, os
from PIL import Image
print("Torch:", torch.__version__)
print("CUDA available:", torch.cuda.is_available())

1) SDXL + IP-Adapter をロード

import torch
from diffusers import AutoPipelineForText2Image

# SDXL ベース
pipe = AutoPipelineForText2Image.from_pretrained(
    "stabilityai/stable-diffusion-xl-base-1.0",
    torch_dtype=torch.float16
).to("cuda")

# ★ IP-Adapter を追加(ロードし忘れると AttributeError になります)
pipe.load_ip_adapter(
    "h94/IP-Adapter",
    subfolder="sdxl_models",
    weight_name="ip-adapter_sdxl.bin"
)

# 省メモリ(必要なら)
# pipe.enable_model_cpu_offload()

2) ロゴ画像をアップロード → 形状保持(ベース生成)

# アップロード
from google.colab import files
uploaded = files.upload()  # 例: logo.png を選択
list(uploaded.keys())[:1]

3) img2img で「金属・木目・布」に変換
共通:img2img パイプライン

from diffusers import AutoPipelineForImage2Image
from PIL import Image

pipe_img2img = AutoPipelineForImage2Image.from_pretrained(
    "stabilityai/stable-diffusion-xl-base-1.0",
    torch_dtype=torch.float16
).to("cuda")

base_logo = Image.open("logo_clean.png").convert("RGB")

3-1) 金属(Metal)

prompt_metal = (
    "embossed logo on brushed silver metal plate, metallic surface, "
    "specular highlights, subtle reflections, anisotropic fine scratches, studio lighting, photorealistic"
)
neg_metal = "wood, fabric, grain, fibers, matte, blurry"

metal = pipe_img2img(
    prompt=prompt_metal,
    negative_prompt=neg_metal,
    image=base_logo,
    strength=0.75,          # ← 質感強め(0.7〜0.8)
    guidance_scale=7.5,
    num_inference_steps=35
).images[0]

metal.save("logo_metal.png")
metal

3-2) 木目(Wood)

prompt_wood = (
    "engraved logo carved into oak wood, detailed oak woodgrain, "
    "visible fibers and pores, varnished oak finish, warm diffuse lighting, photorealistic, macro texture"
)
# 形崩れを抑えるために建築ワードをネガティブへ
neg_wood = "metal, chrome, plastic, architecture, building, house, roof, temple"

wood = pipe_img2img(
    prompt=prompt_wood,
    negative_prompt=neg_wood,
    image=base_logo,
    strength=0.60,          # ← 形保持寄り(0.55〜0.65)
    guidance_scale=7.5,
    num_inference_steps=40
).images[0]

wood.save("logo_wood.png")
wood

3-3) 布(Fabric / 刺繍)

prompt_fabric = (
    "embroidered logo on cotton fabric, stitched threads, textile embroidery, "
    "woven cloth texture, detailed fibers, photorealistic macro, soft diffuse lighting"
)
neg_fabric = "metal, wood, chrome, glossy plastic, painting, smooth surface"

fabric = pipe_img2img(
    prompt=prompt_fabric,
    negative_prompt=neg_fabric,
    image=base_logo,
    strength=0.70,          # ← 繊維を出す(0.65〜0.75)
    guidance_scale=7.5,
    num_inference_steps=40
).images[0]

fabric.save("logo_fabric.png")
fabric

まとめ

IP-Adapterとimg2imgを組み合わせることで、同じロゴが 金属・木目・布 というまったく違う素材感に変身しました。「文字は崩れるけれど形は保持できる」という特性を理解すれば、デザインの試作や遊びに活かせます。
素材が変わるだけでロゴの印象も大きく変化するのは、とても面白い実験でした。


フリーランスエンジニアです。
AIや画像生成の記事色々書いているのでプロフィール見てみてください。

もし以下のようなご要望をお持ちでしたらお気軽にご相談ください。
AIサービスを開発したい、ビジネスにAIを組み込んで効率化したい、AIを使ったスマホアプリを開発したい、
ARを使ったアプリケーションを作りたい、スマホアプリを作りたいけどどこに相談したらいいかわからない…

いずれも中間コストを省いたリーズナブルな価格でお請けできます。

お仕事のご相談はこちらまで
rockyshikoku@gmail.com

機械学習やAR技術を使ったアプリケーションを作っています。
機械学習/AR関連の情報を発信しています。

Twitter
Medium
GitHub

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?