plugins {
id 'java'
id 'org.springframework.boot' version '4.0.6'
id 'io.spring.dependency-management' version '1.1.7'
id 'checkstyle'
id 'com.diffplug.spotless' version '6.25.0'}
checkstyle {
toolVersion ='10.12.0'}
spotless {
java {eclipse()
target 'src/**/*.java'}}
group ='com.example'
version ='0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(26)}}
repositories {mavenCentral()}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
developmentOnly 'org.springframework.boot:spring-boot-docker-compose'
runtimeOnly 'com.mysql:mysql-connector-j'
testImplementation 'org.springframework.boot:spring-boot-starter-data-jpa-test'
testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test'
testImplementation 'org.springframework.boot:spring-boot-testcontainers'
testImplementation 'org.testcontainers:testcontainers-junit-jupiter'
testImplementation 'org.testcontainers:testcontainers-mysql'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'}
tasks.named('test'){useJUnitPlatform()}
追記しているのは以下の部分だけです
plugins {
id 'java'
id 'org.springframework.boot' version '4.0.6'
id 'io.spring.dependency-management' version '1.1.7'
id 'checkstyle'
id 'com.diffplug.spotless' version '6.25.0'}
checkstyle {
toolVersion ='10.12.0'}
spotless {
java {eclipse()
target 'src/**/*.java'}}
config/checkstyle/checkstyle.xml
<?xml version="1.0"?><!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd"><modulename="Checker"><modulename="TreeWalker"><modulename="UnusedImports"/></module></module>
vim src/main/java/com/example/demo/HelloController.java
package com.example.demo;import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.annotation.RestController;@RestControllerpublicclassHelloController{@GetMapping("/")public String index(){return"Greetings from Spring Boot!";}}
次にコントローラを使用するアプリケーションを追加します
これがいわゆるメインファイルになります
vim src/main/java/com/example/demo/Application.java
package com.example.demo;importstatic org.hamcrest.Matchers.equalTo;importstatic org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;importstatic org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;importstatic org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;import org.junit.jupiter.api.Test;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.boot.test.context.SpringBootTest;import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;import org.springframework.http.MediaType;import org.springframework.test.web.servlet.MockMvc;@SpringBootTest@AutoConfigureMockMvcpublicclassHelloControllerTest{@Autowiredprivate MockMvc mvc;@TestpublicvoidgetHello()throws Exception {
mvc.perform(get("/").accept(MediaType.APPLICATION_JSON)).andExpect(status().isOk()).andExpect(content().string(equalTo("Greetings from Spring Boot!")));}}
あとはテストを実行します
./gradlew tasks
でタスクを確認し test タスクを実行します
./gradlew test
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
BUILD SUCCESSFUL in 4s
4 actionable tasks: 2 executed, 2 up-to-date
Consider enabling configuration cache to speed up this build: https://docs.gradle.org/9.4.1/userguide/configuration_cache_enabling.html
最後に
macOS + VSCode で Spring Boot を試してみました
まだ簡単なアプリを起動しただけなので次回はデータベースと連携してみたいと思います
uv run python scripts/generate.py "A realistic cat riding a skateboard on a street, smoothly moving forward, natural motion, full body visible, cinematic lighting, high detail, 4k, camera tracking shot, shallow depth of field" --height 512 --width 512
おそらくこれは M2 Pro mac mini ではエラーになります
動画生成(fp8版)
uv run python scripts/generate.py "A realistic cat riding a skateboard on a street, smoothly moving forward, natural motion, full body visible, cinematic lighting, high detail, 4k, camera tracking shot, shallow depth of field" --height 512 --width 512 --fp8
画像サイズを下げれば何とかこれでもいけるかもしれませんがおそらくこれも不可能です
動画生成(fp8版+低メモリ)
uv run python scripts/generate.py "A realistic cat riding a skateboard on a street" --height 64 --width 96 --fp8 --low-memory --frames 9
おそらくこれでないと M2 Pro mac mini のスペックでは無理かなと思います
画像サイズとプロンプトの長さ、フレーム数も下げています
動画生成(fp8版+低メモリ+fp16フラグ)
uv run python scripts/generate.py "A realistic cat riding a skateboard on a street" --height 64 --width 96 --fp8 --low-memory --frames 9 --fp16 --pipeline one-stage --cfg 5.0
トラブルシューティング
libc++abi: terminating due to uncaught exception of type std::runtime_error: [METAL] Command buffer execution failed: Impacting Interactivity (0000000e:kIOGPUCommandBufferCallbackErrorImpactingInteractivity)
基本的にはメモリ不足が原因です
There appear to be 1 leaked semaphore objects to clean up at shutdown
これもメモリ不足の場合はほとんどです
最後に
LTX2-MLX を M2 Pro mac mini で動かしてみました
何とか動きますが量子化済みのモデルでないと動かないのと生成する動画サイズもかなり小さく短いものでないと無理でした
サーバにインストールしクライアント側にも同じ Mod のインストールが必要です
必ずバージョンは揃えましょう
環境
サーバ側
macOS 26.4.1
Minecraft 1.20.1
forge 47.4.10
TaCZ 1.1.8
クライアント側
macOS 26.4.1/Windows11Home
Minecraft 1.20.1
forge 47.4.10
TaCZ 1.1.8
サーバ側
compose.yaml
サーバ側は docker compose で起動します
vim compose.yaml
services:mc:image: itzg/minecraft-server
tty:truestdin_open:trueports:-"25565:25565"environment:EULA:"TRUE"MODE:"creative"VERSION:"1.21.11"volumes:# attach the relative directory 'data' to the container's /data path- ./data:/data
mc_mod:image: itzg/minecraft-server
tty:truestdin_open:trueports:-"25566:25565"environment:EULA:"TRUE"MODE:"creative"VERSION:"1.20.1"TYPE:"forge"volumes:# modded world/data directory for the modded server- ./modded-data:/data
# put the CurseForge mod JAR into this local directory- ./timeless_and_classics_zero/mods:/data/mods
# optional config directory for mod/server configs- ./timeless_and_classics_zero/config:/data/config