Verfügbarkeitstest für API Provider ergänzt.

This commit is contained in:
2025-12-02 21:51:06 +01:00
parent 908b1dcdff
commit 3ec8e471bc
14 changed files with 565 additions and 26 deletions

View File

@@ -0,0 +1,29 @@
<?php
namespace Database\Factories;
use App\Models\AiModel;
use App\Models\ApiProvider;
use Illuminate\Database\Eloquent\Factories\Factory;
class AiModelFactory extends Factory
{
protected $model = AiModel::class;
public function definition(): array
{
return [
'name' => $this->faker->word() . ' Model',
'model_id' => $this->faker->uuid(),
'model_type' => $this->faker->randomElement(['text-to-image', 'image-to-image', 'inpainting']),
'parameters' => json_encode([
'steps' => 30,
'cfg_scale' => 7.5,
'sampler' => 'Euler a',
'width' => 512,
'height' => 512
]),
'api_provider_id' => ApiProvider::factory(),
];
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace Database\Factories;
use App\Models\ApiProvider;
use Illuminate\Database\Eloquent\Factories\Factory;
class ApiProviderFactory extends Factory
{
protected $model = ApiProvider::class;
public function definition(): array
{
return [
'name' => $this->faker->company(),
'api_url' => $this->faker->url(),
'username' => $this->faker->userName(),
'password' => $this->faker->password(),
'token' => $this->faker->sha256(),
'plugin' => $this->faker->randomElement(['comfyui', 'runwareai']),
'enabled' => $this->faker->boolean(),
];
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace Database\Factories;
use App\Models\Style;
use App\Models\AiModel;
use Illuminate\Database\Eloquent\Factories\Factory;
class StyleFactory extends Factory
{
protected $model = Style::class;
public function definition(): array
{
return [
'title' => $this->faker->words(3, true),
'prompt' => $this->faker->sentence(),
'description' => $this->faker->paragraph(),
'preview_image' => 'styles/preview.jpg',
'parameters' => json_encode([
'positive' => $this->faker->sentence(),
'negative' => $this->faker->sentence(),
'steps' => 30,
'cfg_scale' => 7.5
]),
'ai_model_id' => AiModel::factory(),
'enabled' => $this->faker->boolean(80),
];
}
}