PROPMAN DESIGN 合同会社 | PROPMAN DESIGN LLC.

生成AIラボ:漫画生成AIについて調べてみた…02 | I looked into manga generation AI…02

Home  >>  生成AIラボ:漫画生成AIについて調べてみた…02 | I looked into manga generation AI…02

2024.11.07

Generated with Flux Pro 1.1

率直に生成AIに聞いてみると…

If you ask the generative AI frankly…

Gemini…

具体的な手順
画像の準備:
高画質の画像: 詳細な情報が多いほど、AIがより正確に特徴を捉えられます。
シンプルな背景: 背景が複雑な場合は、AIが主題を誤認識する可能性があります。
キャラクターのポーズ: 多様なポーズの画像があると、より表現豊かな漫画を作成できます。
AIモデルの選択:
Stable Diffusion: 自由度が高く、様々なスタイルの画像生成が可能です。
Midjourney: 高品質な画像生成に定評がありますが、学習データの偏りがある場合があります。
DALL-E 2: テキスト説明に基づいた画像生成に優れています。
プロンプトの作成:
詳細な描写: 画像の特徴(キャラクター、背景、雰囲気など)をできるだけ具体的に記述します。
スタイル指定: 漫画のジャンル、画風、雰囲気などを指定します。
指示語: 「漫画のコマのように」「吹き出しを追加して」など、生成したい画像の形式を指示します。
画像生成:
複数回生成: 同じプロンプトで複数回生成し、最適な画像を選びます。
パラメータ調整: AIモデルによっては、様々なパラメータを調整することで、生成画像を微調整できます。
画像の編集:
画像編集ソフト: 生成された画像を、お好みの画像編集ソフトで加工します。
コマ割り: 漫画の構成に合わせて、画像を分割します。
セリフの追加: 吹き出しを作成し、セリフを入力します。

Gemini…

Specific steps
Image preparation:
High-quality images: The more detailed the image, the more accurately the AI ​​can capture the features.
Simple background: If the background is complex, the AI ​​may misidentify the subject.
Character poses: Images with a variety of poses will allow you to create more expressive manga.
AI model selection:
Stable Diffusion: High degree of freedom, allowing for image generation in various styles.
Midjourney: Well-known for high-quality image generation, but training data may be biased.
DALL-E 2: Excellent at image generation based on text descriptions.
Prompt creation:
Detailed description: Describe the image features (characters, background, atmosphere, etc.) as specifically as possible.
Style specification: Specify the genre, style, atmosphere, etc. of the manga.
Instructive words: Indicate the format of the image you want to generate, such as “like a manga panel” or “add speech bubbles.”
Image generation:
Generate multiple times: Generate multiple times with the same prompt and choose the best image.
Parameter adjustment: Depending on the AI ​​model, you can fine-tune the generated image by adjusting various parameters.
Image editing:
Image editing software: Process the generated image using your preferred image editing software.
Frame division: Divide the image into panels to fit the structure of your manga.
Add dialogue: Create speech bubbles and enter dialogue.

Perplexity

準備
まず、以下のツールを用意します:
元となる1枚の画像
AI画像生成ツール (例: Reimagine XL, Canva, AIピカソなど)
漫画制作支援ツール (例: World Maker, SkyReelsなど)
手順

  1. 元画像の準備
    漫画のベースとなる1枚の画像を選びます。キャラクターや背景など、漫画の核となる要素が含まれているものが理想的です2。
  2. AI画像生成
    選んだAI画像生成ツールを使って、元画像から複数の類似画像を生成します。
  3. 漫画コマの作成
    生成された画像を使って、漫画のコマを作成します。
  4. ストーリー構築
    ChatGPTなどのAIツールを活用して、ストーリーやセリフを考案します。
  5. 編集と仕上げ
    漫画制作支援ツールを使って、コマの配置や全体的なレイアウトを調整します。

Perplexity

Preparation
First, prepare the following tools:
A single source image
AI image generation tool (e.g. Reimagine XL, Canva, AI Picasso, etc.)
Manga production support tool (e.g. World Maker, SkyReels, etc.)
Steps

  1. Prepare source image
    Choose a single image that will be the base of your manga. Ideally, it should contain the core elements of your manga, such as characters and background2.
  2. AI image generation
    Use the AI ​​image generation tool you selected to generate multiple similar images from the source image.
  3. Create manga panels
    Use the generated images to create manga panels.
  4. Story construction
    Use an AI tool such as ChatGPT to come up with a story and dialogue.
  5. Editing and finishing
    Use the manga production support tool to adjust the placement of the panels and the overall layout.

Claude…

漫画を作成するためのPythonスクリプトを作成します。主にdiffusersライブラリを使用して、1枚の画像から複数のコマを生成する方法を実装します。

import torch
from diffusers import StableDiffusionImg2ImgPipeline
from PIL import Image
import numpy as np

class MangaGenerator:
    def __init__(self, model_id="runwayml/stable-diffusion-v1-5"):
        """
        マンガジェネレーターの初期化
        Args:
            model_id: 使用する画像生成モデルのID
        """
        self.device = "cuda" if torch.cuda.is_available() else "cpu"
        self.pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
            model_id,
            torch_dtype=torch.float16 if self.device == "cuda" else torch.float32
        ).to(self.device)

    def prepare_image(self, image_path, target_size=(512, 512)):
        """
        入力画像の前処理
        """
        image = Image.open(image_path)
        image = image.convert("RGB")
        image = image.resize(target_size, Image.LANCZOS)
        return image

    def generate_panel(self, init_image, prompt, style_prompt="manga style, black and white", 
                      strength=0.75, guidance_scale=7.5):
        """
        1つのマンガパネルを生成
        """
        prompt = f"{prompt}, {style_prompt}"

        image = self.pipe(
            prompt=prompt,
            image=init_image,
            strength=strength,
            guidance_scale=guidance_scale
        ).images[0]

        return image

    def create_manga_page(self, init_image, prompts, layout="2x2"):
        """
        マンガページを生成
        Args:
            init_image: 元となる画像のパス
            prompts: 各パネルの説明文のリスト
            layout: パネルのレイアウト ("2x2" または "1x4")
        """
        init_image = self.prepare_image(init_image)
        panels = []

        for prompt in prompts:
            panel = self.generate_panel(init_image, prompt)
            panels.append(panel)

        # ページレイアウトの作成
        if layout == "2x2":
            width = height = 1024
            page = Image.new('RGB', (width, height), 'white')

            # パネルの配置
            positions = [
                (0, 0),          # 左上
                (width//2, 0),   # 右上
                (0, height//2),  # 左下
                (width//2, height//2)  # 右下
            ]

            for panel, pos in zip(panels, positions):
                panel = panel.resize((width//2, height//2))
                page.paste(panel, pos)

        elif layout == "1x4":
            width = 512
            height = 2048
            page = Image.new('RGB', (width, height), 'white')

            for i, panel in enumerate(panels):
                page.paste(panel, (0, i * 512))

        return page

    def add_speech_bubbles(self, page, texts, positions):
        """
        吹き出しを追加(基本的な実装)
        """
        from PIL import ImageDraw, ImageFont
        draw = ImageDraw.Draw(page)

        # 日本語フォントのパスを指定(システムに応じて変更が必要)
        try:
            font = ImageFont.truetype("./fonts/NotoSansJP-Regular.otf", 24)
        except:
            font = ImageFont.load_default()

        for text, pos in zip(texts, positions):
            # 簡単な白い背景の吹き出し
            text_bbox = draw.textbbox(pos, text, font=font)
            draw.rectangle([
                text_bbox[0] - 10, text_bbox[1] - 10,
                text_bbox[2] + 10, text_bbox[3] + 10
            ], fill="white", outline="black")
            draw.text(pos, text, fill="black", font=font)

        return page

def main():
    # 使用例
    generator = MangaGenerator()

    # 4コマ漫画の生成
    prompts = [
        "キャラクターが公園で散歩している",
        "友達に出会って話している",
        "一緒にアイスクリームを食べている",
        "夕日を見ながら別れる"
    ]

    page = generator.create_manga_page(
        "input_image.jpg",
        prompts,
        layout="2x2"
    )

    # 吹き出しの追加
    texts = [
        "いい天気だな〜",
        "あ、○○ちゃん!",
        "アイス美味しいね!",
        "また明日!"
    ]
    positions = [(100, 100), (600, 100), (100, 600), (600, 600)]

    page_with_text = generator.add_speech_bubbles(page, texts, positions)
    page_with_text.save("manga_output.jpg")

if __name__ == "__main__":
    main()

このスクリプトの主な機能は以下の通りです:

  1. 画像処理
  • 入力画像のサイズ調整と前処理
  • Stable Diffusionモデルを使用した画像生成
  • マンガ調のスタイル適用
  1. レイアウト機能
  • 2×2グリッドまたは1×4の縦長レイアウト
  • 複数のパネルを1ページに配置
  1. 吹き出し機能
  • テキストの追加
  • 簡単な吹き出しの描画

使用方法:

  1. 必要なライブラリをインストール:
pip install torch diffusers pillow
  1. 入力画像とプロンプトを準備し、スクリプトを実行:
generator = MangaGenerator()
prompts = ["シーン1の説明", "シーン2の説明", "シーン3の説明", "シーン4の説明"]
page = generator.create_manga_page("input_image.jpg", prompts)

カスタマイズのポイント:

  • style_promptを変更して異なる画風を試す
  • strengthパラメータを調整して元画像の影響度を変更
  • レイアウトを”2×2″か”1×4″で選択
  • 吹き出しのデザインやフォントをカスタマイズ

改善したい点がありましたら、お知らせください。例えば:

  • より複雑なパネルレイアウト
  • 高度な吹き出しデザイン
  • 特定の漫画スタイルの強化
  • その他の機能追加

Claude…

I’m creating a Python script to create a comic. I’ll mainly use the diffusers library to implement a way to generate multiple frames from a single image.

import torch
from diffusers import StableDiffusionImg2ImgPipeline
from PIL import Image
import numpy as np

class MangaGenerator:
def init(self, model_id=”runwayml/stable-diffusion-v1-5″):
“”
Initialize manga generator
Args:
model_id: ID of image generation model to use
“””
self.device = “cuda” if torch.cuda.is_available() else “cpu”
self.pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
model_id,
torch_dtype=torch.float16 if self.device == “cuda” else torch.float32
).to(self.device)

def prepare_image(self, image_path, target_size=(512, 512)):
“”
Preprocess input image
“””
image = Image.open(image_path)
image = image.convert(“RGB”)
image = image.resize(target_size, Image.LANCZOS)
return image

def generate_panel(self, init_image, prompt, style_prompt=”manga style, black and white”,
strength=0.75, guidance_scale=7.5):
“””
Generate one manga panel
“””
prompt = f”{prompt}, {style_prompt}”

image = self.pipe(
prompt=prompt,
image=init_image,
strength=strength,
guidance_scale=guidance_scale
).images[0]

return image

def create_manga_page(self, init_image, prompts, layout=”2×2″):
“””
Generate a manga page
Args:
init_image: Path to the original image
prompts: List of descriptions for each panel
layout: Panel layout (“2×2” or “1×4”)
“””
init_image = self.prepare_image(init_image)
panels = []
for prompt in prompts:
panel = self.generate_panel(init_image, prompt)
panels.append(panel)

Create page layout

if layout == “2×2”:
width = height = 1024
page = Image.new(‘RGB’, (width, height), ‘white’)

Position panels

positions = [
(0, 0), # Top left
(width//2, 0), # Top right
(0, height//2), # Bottom left
(width//2, height//2) # Bottom right
]
for panel, pos in zip(panels, positions):
panel = panel.resize((width//2, height//2))
page.paste(panel, pos)

elif layout == “1×4”:
width = 512
height = 2048
page = Image.new(‘RGB’, (width, height), ‘white’)

for i, panel in enumerate(panels):
page.paste(panel, (0, i * 512))

return page

def add_speech_bubbles(self, page, texts, positions):
“””
Add speech bubbles (basic implementation)
“””
from PIL import ImageDraw, ImageFont
draw = ImageDraw.Draw(page)

Specify the path to the Japanese font (need to change depending on your system)

try:
font = ImageFont.truetype(“./fonts/NotoSansJP-Regular.otf”, 24)
except:
font = ImageFont.load_default()

for text, pos in zip(texts, positions):

A simple speech bubble with a white background

text_bbox = draw.textbbox(pos, text, font=font)

draw.rectangle([
text_bbox[0] – 10, text_bbox[1] – 10,
text_bbox[2] + 10, text_bbox[3] + 10
], fill=”white”, outline=”black”)

draw.text(pos, text, fill=”black”, font=font)

return page

def main():

Example

generator = MangaGenerator()

Generate 4-panel manga

prompts = [
“Character is walking in the park”,
“Meeting and talking with friends”,
“Eating ice cream together”,
“Parting while watching the sunset”

page = generator.create_manga_page(
“input_image.jpg”,
prompts,
layout=”2×2″
)

Add speech bubble

texts = [
“Nice weather”,
“Oh, XX-chan!”,
“Ice cream is delicious! “,
“See you tomorrow! “
]
positions = [(100, 100), (600, 100), (100, 600), (600, 600)]

page_with_text = generator.add_speech_bubbles(page, texts, positions)
page_with_text.save(“manga_output.jpg”)

if name == “main“:
main()

The main functions of this script are:

Image processing

Resize and preprocess input images

Image generation using Stable Diffusion model

Apply manga style

Layout functions

2×2 grid or 1×4 vertical layout

Place multiple panels on one page

Speech bubble functions

Add text

Draw simple speech bubbles

How to use:

Install required libraries:

pip install torch diffusers pillow

Prepare input images and prompts and run the script:

generator = MangaGenerator()
prompts = [“Scene 1 description”, “Scene 2 description”, “Scene 3 description”, “Scene 4 description”]
page = generator.create_manga_page(“input_image.jpg”, prompts)

Customization tips:

Change style_prompt to try different styles

Adjust the strength parameter to change the influence of the original image

Select layout “2×2” or “1×4”

Customize speech bubble design and font

Please let us know if there are any improvements you would like to make. For example:

More complex panel layouts

Advanced speech bubble design

Enhancements to specific manga styles

Additional features

結局…それができるプラットフォームは無い…一枚ずつ画像生成して組んでいくしかない!ですね…。

In the end, there is no platform that can do that… You have to generate the images one by one and assemble them! That’s right…





Generation AI Lab:生成AIラボ

2025.04.14 AIに指示を出すことで簡単にウェブサイトのひな形を作成できる…WordPress.comの「AI Website Builder」をいじってみた…。 You can easily create a website template by giving instructions to AI…I played around with WordPress.com's "AI Website Builder"… https://wordpress.com/ai-website-builder 先ずは...Googleアカウントでログイン...で...チャットに沿って入力... First, log in with your Google account…Then, enter the information according to the chat… こんな感じ...。で...ここまでは無料でいじれる!これ以降の...画像を変えたり...編集したり...ドメイン設定したり...は有料になっちゃうみたいですね...。 まぁ...簡単ではあるけど...どうなんだろう? It ...
2025.04.13 一日3枚まで画像生成可能になった無料版「ChatGPT」で...テキストから画像生成をいじってみた...。無料版は「DALL-E 3」のままなのかな? Using the free version of "ChatGPT," which allows you to generate up to three images per day, I decided to tinker with generating images from text.I wonder if the free version will remain "DALL-E 3"? プロンプト...「月面を探索する3人の宇宙飛行士、後ろに宇宙船、地球が見える」 Prompt… "Three astronauts exploring the surface of the moon, a spaceship in the background, Earth in view" プロンプト...「渋谷のスクランブル交差点を自由を求めてデモ行進するアンドロイドロボット集団、たくさんの人々が観ている」 Promp ...
2025.04.11 3Dモデル生成サービス「Meshy」の最新バージョン…「Meshy-5 Preview」がリリースされたのでいじってみた… The latest version of the 3D model generation service "Meshy"…"Meshy-5 Preview" has been released, so I decided to play around with it… https://www.meshy.ai/discover 画像から生成を...昨日の「TripoSG」と同じ画像で…トライ! Generate from images…Try it with the same image as yesterday’s “TripoSG”! ... 「Meshy-5 Preview」は、AIを利用した3Dモデル生成サービス「Meshy」の最新バージョンで、2025年3月28日にリリースされました。このプレビュー版では、以下のような新機能と改善が行われています。主な機能と改善点: 高精細なメッシュ生成: Meshy-5では、テクスチャからのライ ...
2025.04.11 画像から高精細な3Dジオメトリを生成するための新しいオープンソースプロジェクト...3Dモデル生成AI「Hi3DGen v0.1」を Hugging Face でいじってみた...。 A new open source project for generating high-resolution 3D geometry from images…I played around with the 3D model generation AI "Hi3DGen v0.1" on Hugging Face… https://stable-x.github.io/Hi3DGen 昨日の「TripoSG」と同じ画像で...トライ! Try it with the same image as yesterday's "TripoSG"! 無料のHugging Faceだと…ここで終了…😭 If it's a free Hugging Face, it ends here…😭 ... 3Dモデル生成AI「Hi3DGen v0.1」は、画像から高精細 ...
2025.04.10 ブログで紹介した「TripoSG」を...無料デモ…Hugging Faceでいじってみた...。 I introduced "TripoSG" on my blog…I tried playing around with the free demo… with Hugging Face… 「Tripo」…3D生成AIのスタンダードになるのか!? 元画像を...Fluxで生成して... Generate the original image with Flux… 無料のHugging Faceだと...テクスチャーの反映までできず...😭 The free Hugging Face doesn't even let you apply textures…😭 もう...ここまで来てるのかぁ...もう直ぐ...仕事で使えるようになるなぁ... つづく... It's come so far already…I'll be able to use it at work soon… To be continued… Genera ...
2025.04.08 Blog Propman MEMO 「ものづくり」備忘録?のアイキャッチ画像+αを... Midjourney・Flux・Imagen・Adobe Firefly・Copilot Designer・Ideogram・VIVA・Vidu・Kling・Runway・Dream Machine・Haiper...等々で生成しています。 Blog Propman MEMO "Manufacturing" memo? Eye-catching images + more…Created using Midjourney, Flux, Imagen, Adobe Firefly, Copilot Designer, Ideogram, VIVA, Vidu, Kling, Runway, Dream Machine, Haiper…etc. Generation AI Lab:生成AIラボ ...
2025.04.08 Midjourney V7がリリースされた... 主な特徴 高い画像品質: V7は、テキストプロンプトに対する忠実性が向上しており、特に手や体の描写が大幅に改善されています。ユーザーからの報告によると、V7はフォトリアルな人間の手を生成する能力があるとされています。ドラフトモード: 新たに追加された「ドラフトモード」では、画像を通常の半分のコストで、10倍の速度で生成できます。このモードは、アイデアを素早く試すためのもので、生成された画像は品質が低めですが、気に入った画像を「強化」または「バリエーション」を使って再生成することが可能です。パーソナライズ機能: V7では、ユーザーが自分の好みに基づいてAIをトレーニングするためのパーソナライズ機能がデフォルトで有効になっています。ユーザーは、200対の画像を評価することで、自分のスタイルをAIに学習させる必要があります。操作モード: V7には「ターボモード」と「リラックスモード」があり、ターボモードは高性能ですがコストが高く、リラックスモードは時間がかかりますがコストが低く設定されています。標準モードは現在開発中で、 ...
2025.04.06 macOSが15.4に...iOSが18.4になって...標準で...「Image Playground」が使えるようになったので...スタイルによる画像生成をいじってみた...。 プロンプト...「大海を泳ぐ鯨の群れ」 macOS is now 15.4…iOS is now 18.4…"Image Playground" is now available as standard…So I immediately started playing around with image generation using styles. Prompt… "A pod of whales swimming in the ocean" 提案「無し」 Proposal "None" Style "Sketch" Style "Illustration" Style "Anime" 提案「夕日」 Proposal "Sunset" Style "Sketch" Style "Illustration" Style "Anime" 提案「星空」 Proposal: "Starry ...
2025.03.15 シンガポールを拠点とするHIX.AIによって開発された...オールインワンのAI動画生成プラットフォーム「Pollo.ai」 メールで...体験〜執筆依頼が来ていましたが...一先ず...無料でいじってみた...。 "Pollo.ai" is an all-in-one AI video generation platform developed by Singapore-based HIX.AI. I received an email asking me to try it out and write about it, but for now I decided to try it out for free. https://pollo.ai/ja 画像生成は...Recraft 、 Stable Diffusion、 FLUX、 DALL·E 、 Imagen...動画生成は...Kling AI、 Runway、 Hailuo AI、 Vidu AI、 Luma AI AI、 Pika AI AI、 PixVerse AI、 Seaweed、 Wanx ...
2025.03.09 Blog Propman MEMO 「ものづくり」備忘録?のアイキャッチ画像+αを... Midjourney・Flux・Imagen・Adobe Firefly・Copilot Designer・Ideogram・VIVA・Vidu・Kling・Runway・Dream Machine・Haiper・hailuo...等々で生成しています。 Blog Propman MEMO "Manufacturing" memo? Eye-catching images + more…Created using Midjourney, Flux, Imagen, Adobe Firefly, Copilot Designer, Ideogram, VIVA, Vidu, Kling, Runway, Dream Machine, Haiper, hailuo…etc. Generation AI Lab:生成AIラボ ...