mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 01:21:09 +02:00
fix: resolve port conflict (mana-image-gen 3025→3026) and replace APP_URLS with internal routes
- mana-image-gen: change default port from 3025 to 3026 to avoid conflict with mana-llm
- Dashboard widgets (12): replace APP_URLS.{app}.dev/prod with internal route paths (/todo, /calendar, etc.)
and remove target="_blank" since all apps are now internal routes in the unified app
- Home page: use goto() for internal apps, keep window.open() only for external apps (matrix, arcade)
- AppRow: remove unused APP_URLS import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
67567605fa
commit
35f4bd48de
18 changed files with 48 additions and 137 deletions
|
|
@ -1,6 +1,5 @@
|
|||
<script lang="ts">
|
||||
import type { ManaApp, AppIconId } from '@manacore/shared-branding';
|
||||
import { APP_URLS } from '@manacore/shared-branding';
|
||||
|
||||
interface Props {
|
||||
apps: ManaApp[];
|
||||
|
|
|
|||
|
|
@ -8,10 +8,6 @@
|
|||
|
||||
import { _ } from 'svelte-i18n';
|
||||
import { useUpcomingEvents } from '$lib/data/cross-app-queries';
|
||||
import { APP_URLS } from '@manacore/shared-branding';
|
||||
|
||||
const isDev = typeof window !== 'undefined' && window.location.hostname === 'localhost';
|
||||
const calendarUrl = isDev ? APP_URLS.calendar.dev : APP_URLS.calendar.prod;
|
||||
|
||||
const events = useUpcomingEvents(7);
|
||||
|
||||
|
|
@ -94,9 +90,7 @@
|
|||
|
||||
{#if remainingCount > 0}
|
||||
<a
|
||||
href={calendarUrl}
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
href="/calendar"
|
||||
class="block rounded-lg py-2 text-center text-sm text-primary hover:bg-primary/5"
|
||||
>
|
||||
+{remainingCount} weitere
|
||||
|
|
|
|||
|
|
@ -5,12 +5,8 @@
|
|||
|
||||
import { _ } from 'svelte-i18n';
|
||||
import { useCardsProgress } from '$lib/data/cross-app-queries';
|
||||
import { APP_URLS } from '@manacore/shared-branding';
|
||||
|
||||
const progress = useCardsProgress();
|
||||
|
||||
const isDev = typeof window !== 'undefined' && window.location.hostname === 'localhost';
|
||||
const cardsUrl = isDev ? APP_URLS.cards.dev : APP_URLS.cards.prod;
|
||||
</script>
|
||||
|
||||
<div>
|
||||
|
|
@ -49,9 +45,7 @@
|
|||
|
||||
{#if progress.value.dueForReview > 0}
|
||||
<a
|
||||
href={cardsUrl}
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
href="/cards"
|
||||
class="block rounded-lg bg-primary/10 py-2 text-center text-sm font-medium text-primary hover:bg-primary/20"
|
||||
>
|
||||
{progress.value.dueForReview} Karten wiederholen →
|
||||
|
|
|
|||
|
|
@ -5,13 +5,9 @@
|
|||
|
||||
import { _ } from 'svelte-i18n';
|
||||
import { useRecentConversations } from '$lib/data/cross-app-queries';
|
||||
import { APP_URLS } from '@manacore/shared-branding';
|
||||
|
||||
const conversations = useRecentConversations(5);
|
||||
|
||||
const isDev = typeof window !== 'undefined' && window.location.hostname === 'localhost';
|
||||
const chatUrl = isDev ? APP_URLS.chat.dev : APP_URLS.chat.prod;
|
||||
|
||||
function formatTime(dateStr?: string): string {
|
||||
if (!dateStr) return '';
|
||||
const date = new Date(dateStr);
|
||||
|
|
@ -46,9 +42,7 @@
|
|||
<div class="space-y-1">
|
||||
{#each conversations.value ?? [] as conv (conv.id)}
|
||||
<a
|
||||
href="{chatUrl}/chat/{conv.id}"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
href="/chat/{conv.id}"
|
||||
class="flex items-center gap-3 rounded-lg px-2 py-1.5 transition-colors hover:bg-surface-hover"
|
||||
>
|
||||
<div class="min-w-0 flex-1">
|
||||
|
|
|
|||
|
|
@ -5,14 +5,10 @@
|
|||
|
||||
import { _ } from 'svelte-i18n';
|
||||
import { useEnabledAlarms, useActiveTimers } from '$lib/data/cross-app-queries';
|
||||
import { APP_URLS } from '@manacore/shared-branding';
|
||||
|
||||
const alarms = useEnabledAlarms();
|
||||
const timers = useActiveTimers();
|
||||
|
||||
const isDev = typeof window !== 'undefined' && window.location.hostname === 'localhost';
|
||||
const clockUrl = isDev ? APP_URLS.clock.dev : APP_URLS.clock.prod;
|
||||
|
||||
const DAY_NAMES = ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'];
|
||||
|
||||
function formatRepeatDays(days?: number[]): string {
|
||||
|
|
@ -87,12 +83,7 @@
|
|||
</div>
|
||||
{/if}
|
||||
|
||||
<a
|
||||
href={clockUrl}
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
class="mt-2 block text-center text-sm text-primary hover:underline"
|
||||
>
|
||||
<a href="/clock" class="mt-2 block text-center text-sm text-primary hover:underline">
|
||||
Uhr öffnen →
|
||||
</a>
|
||||
{/if}
|
||||
|
|
|
|||
|
|
@ -8,14 +8,10 @@
|
|||
|
||||
import { _ } from 'svelte-i18n';
|
||||
import { useFavoriteContacts } from '$lib/data/cross-app-queries';
|
||||
import { APP_URLS } from '@manacore/shared-branding';
|
||||
|
||||
const MAX_DISPLAY = 5;
|
||||
const contacts = useFavoriteContacts(MAX_DISPLAY);
|
||||
|
||||
const isDev = typeof window !== 'undefined' && window.location.hostname === 'localhost';
|
||||
const contactsUrl = isDev ? APP_URLS.contacts.dev : APP_URLS.contacts.prod;
|
||||
|
||||
function getDisplayName(contact: any): string {
|
||||
const parts = [contact.firstName, contact.lastName].filter(Boolean);
|
||||
return parts.length > 0 ? parts.join(' ') : contact.email || 'Unbekannt';
|
||||
|
|
@ -52,9 +48,7 @@
|
|||
{$_('dashboard.widgets.contacts.empty')}
|
||||
</p>
|
||||
<a
|
||||
href={contactsUrl}
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
href="/contacts"
|
||||
class="mt-3 inline-block rounded-lg bg-primary/10 px-4 py-2 text-sm font-medium text-primary hover:bg-primary/20"
|
||||
>
|
||||
{$_('dashboard.widgets.contacts.add_favorites')}
|
||||
|
|
@ -64,9 +58,7 @@
|
|||
<div class="space-y-2">
|
||||
{#each contacts.value ?? [] as contact (contact.id)}
|
||||
<a
|
||||
href="{contactsUrl}/contacts/{contact.id}"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
href="/contacts/{contact.id}"
|
||||
class="flex items-center gap-3 rounded-lg p-2 transition-colors hover:bg-surface-hover"
|
||||
>
|
||||
<div
|
||||
|
|
@ -93,12 +85,7 @@
|
|||
{/each}
|
||||
</div>
|
||||
|
||||
<a
|
||||
href={contactsUrl}
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
class="mt-3 block text-center text-sm text-primary hover:underline"
|
||||
>
|
||||
<a href="/contacts" class="mt-3 block text-center text-sm text-primary hover:underline">
|
||||
{$_('dashboard.widgets.contacts.view_all')} →
|
||||
</a>
|
||||
{/if}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,10 @@
|
|||
|
||||
import { _ } from 'svelte-i18n';
|
||||
import { useRecentDocuments, useSpaces } from '$lib/data/cross-app-queries';
|
||||
import { APP_URLS } from '@manacore/shared-branding';
|
||||
|
||||
const docs = useRecentDocuments(5);
|
||||
const spaces = useSpaces();
|
||||
|
||||
const isDev = typeof window !== 'undefined' && window.location.hostname === 'localhost';
|
||||
const contextUrl = isDev ? APP_URLS.context.dev : APP_URLS.context.prod;
|
||||
|
||||
function getSpaceName(spaceId: string): string {
|
||||
const space = (spaces.value ?? []).find((s) => s.id === spaceId);
|
||||
return space?.name ?? '';
|
||||
|
|
@ -53,9 +49,7 @@
|
|||
<div class="space-y-1">
|
||||
{#each docs.value ?? [] as doc (doc.id)}
|
||||
<a
|
||||
href="{contextUrl}/spaces/{doc.spaceId}/documents/{doc.id}"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
href="/context/documents/{doc.id}"
|
||||
class="flex items-center gap-2 rounded-lg px-2 py-1.5 transition-colors hover:bg-surface-hover"
|
||||
>
|
||||
<span>{typeIcons[doc.type ?? 'text'] ?? '📄'}</span>
|
||||
|
|
|
|||
|
|
@ -5,12 +5,8 @@
|
|||
|
||||
import { _ } from 'svelte-i18n';
|
||||
import { useRecentImages } from '$lib/data/cross-app-queries';
|
||||
import { APP_URLS } from '@manacore/shared-branding';
|
||||
|
||||
const images = useRecentImages(6);
|
||||
|
||||
const isDev = typeof window !== 'undefined' && window.location.hostname === 'localhost';
|
||||
const pictureUrl = isDev ? APP_URLS.picture.dev : APP_URLS.picture.prod;
|
||||
</script>
|
||||
|
||||
<div>
|
||||
|
|
@ -36,9 +32,7 @@
|
|||
<div class="grid grid-cols-3 gap-2">
|
||||
{#each images.value ?? [] as image (image.id)}
|
||||
<a
|
||||
href="{pictureUrl}/images/{image.id}"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
href="/picture"
|
||||
class="group relative aspect-square overflow-hidden rounded-lg bg-surface-hover"
|
||||
>
|
||||
{#if image.publicUrl}
|
||||
|
|
|
|||
|
|
@ -5,13 +5,9 @@
|
|||
|
||||
import { _ } from 'svelte-i18n';
|
||||
import { useRecentDecks } from '$lib/data/cross-app-queries';
|
||||
import { APP_URLS } from '@manacore/shared-branding';
|
||||
|
||||
const decks = useRecentDecks(5);
|
||||
|
||||
const isDev = typeof window !== 'undefined' && window.location.hostname === 'localhost';
|
||||
const presiUrl = isDev ? APP_URLS.presi.dev : APP_URLS.presi.prod;
|
||||
|
||||
function formatDate(dateStr?: string): string {
|
||||
if (!dateStr) return '';
|
||||
return new Date(dateStr).toLocaleDateString('de-DE', { day: 'numeric', month: 'short' });
|
||||
|
|
@ -41,9 +37,7 @@
|
|||
<div class="space-y-1">
|
||||
{#each decks.value ?? [] as deck (deck.id)}
|
||||
<a
|
||||
href="{presiUrl}/decks/{deck.id}"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
href="/presi/deck/{deck.id}"
|
||||
class="flex items-center gap-2 rounded-lg px-2 py-1.5 transition-colors hover:bg-surface-hover"
|
||||
>
|
||||
<div class="min-w-0 flex-1">
|
||||
|
|
|
|||
|
|
@ -5,13 +5,9 @@
|
|||
|
||||
import { _ } from 'svelte-i18n';
|
||||
import { useStorageStats } from '$lib/data/cross-app-queries';
|
||||
import { APP_URLS } from '@manacore/shared-branding';
|
||||
|
||||
const stats = useStorageStats();
|
||||
|
||||
const isDev = typeof window !== 'undefined' && window.location.hostname === 'localhost';
|
||||
const storageUrl = isDev ? APP_URLS.storage.dev : APP_URLS.storage.prod;
|
||||
|
||||
function formatSize(bytes: number): string {
|
||||
if (bytes === 0) return '0 B';
|
||||
const units = ['B', 'KB', 'MB', 'GB'];
|
||||
|
|
@ -71,12 +67,7 @@
|
|||
</div>
|
||||
{/if}
|
||||
|
||||
<a
|
||||
href={storageUrl}
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
class="mt-2 block text-center text-sm text-primary hover:underline"
|
||||
>
|
||||
<a href="/storage" class="mt-2 block text-center text-sm text-primary hover:underline">
|
||||
Storage öffnen →
|
||||
</a>
|
||||
{/if}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
import { _ } from 'svelte-i18n';
|
||||
import { useOpenTasks } from '$lib/data/cross-app-queries';
|
||||
import { db } from '$lib/data/database';
|
||||
import { APP_URLS } from '@manacore/shared-branding';
|
||||
import { format, isToday, isTomorrow, isPast } from 'date-fns';
|
||||
import { de } from 'date-fns/locale';
|
||||
|
||||
|
|
@ -31,9 +30,6 @@
|
|||
|
||||
const MAX_DISPLAY = 5;
|
||||
|
||||
const isDev = typeof window !== 'undefined' && window.location.hostname === 'localhost';
|
||||
const todoUrl = isDev ? APP_URLS.todo.dev : APP_URLS.todo.prod;
|
||||
|
||||
const priorityColors: Record<string, string> = {
|
||||
urgent: '#ef4444',
|
||||
high: '#f97316',
|
||||
|
|
@ -103,9 +99,7 @@
|
|||
<div class="space-y-1">
|
||||
{#each displayedTasks as task (task.id)}
|
||||
<a
|
||||
href={todoUrl}
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
href="/todo"
|
||||
class="flex items-center gap-2.5 rounded-lg px-2 py-1.5 transition-colors hover:bg-surface-hover"
|
||||
>
|
||||
<!-- Priority dot -->
|
||||
|
|
@ -174,9 +168,7 @@
|
|||
|
||||
{#if remainingCount > 0}
|
||||
<a
|
||||
href={todoUrl}
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
href="/todo"
|
||||
class="block rounded-lg py-2 text-center text-sm text-primary hover:bg-primary/5"
|
||||
>
|
||||
{$_('dashboard.widgets.tasks_today.view_all', { values: { count: remainingCount } })}
|
||||
|
|
|
|||
|
|
@ -8,15 +8,11 @@
|
|||
|
||||
import { _ } from 'svelte-i18n';
|
||||
import { useUpcomingTasks } from '$lib/data/cross-app-queries';
|
||||
import { APP_URLS } from '@manacore/shared-branding';
|
||||
|
||||
const tasks = useUpcomingTasks(7);
|
||||
|
||||
const MAX_DISPLAY = 5;
|
||||
|
||||
const isDev = typeof window !== 'undefined' && window.location.hostname === 'localhost';
|
||||
const todoUrl = isDev ? APP_URLS.todo.dev : APP_URLS.todo.prod;
|
||||
|
||||
const priorityColors: Record<string, string> = {
|
||||
urgent: '#ef4444',
|
||||
high: '#f97316',
|
||||
|
|
@ -80,9 +76,7 @@
|
|||
<div class="space-y-1">
|
||||
{#each displayedTasks as task (task.id)}
|
||||
<a
|
||||
href={todoUrl}
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
href="/todo"
|
||||
class="flex items-center gap-2.5 rounded-lg px-2 py-1.5 transition-colors hover:bg-surface-hover"
|
||||
>
|
||||
<!-- Priority dot -->
|
||||
|
|
@ -115,9 +109,7 @@
|
|||
|
||||
{#if remainingCount > 0}
|
||||
<a
|
||||
href={todoUrl}
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
href="/todo"
|
||||
class="block rounded-lg py-2 text-center text-sm text-primary hover:bg-primary/5"
|
||||
>
|
||||
+{remainingCount} weitere
|
||||
|
|
|
|||
|
|
@ -5,12 +5,8 @@
|
|||
|
||||
import { _ } from 'svelte-i18n';
|
||||
import { useRandomFavorite } from '$lib/data/cross-app-queries';
|
||||
import { APP_URLS } from '@manacore/shared-branding';
|
||||
|
||||
const favorite = useRandomFavorite();
|
||||
|
||||
const isDev = typeof window !== 'undefined' && window.location.hostname === 'localhost';
|
||||
const zitareUrl = isDev ? APP_URLS.zitare.dev : APP_URLS.zitare.prod;
|
||||
</script>
|
||||
|
||||
<div>
|
||||
|
|
@ -28,21 +24,14 @@
|
|||
<div class="mb-2 text-3xl">💡</div>
|
||||
<p class="text-sm text-muted-foreground">{$_('dashboard.widgets.zitare.empty')}</p>
|
||||
<a
|
||||
href={zitareUrl}
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
href="/zitare"
|
||||
class="mt-3 inline-block rounded-lg bg-primary/10 px-4 py-2 text-sm font-medium text-primary hover:bg-primary/20"
|
||||
>
|
||||
Zitate entdecken
|
||||
</a>
|
||||
</div>
|
||||
{:else}
|
||||
<a
|
||||
href={zitareUrl}
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
class="block rounded-lg p-3 transition-colors hover:bg-surface-hover"
|
||||
>
|
||||
<a href="/zitare" class="block rounded-lg p-3 transition-colors hover:bg-surface-hover">
|
||||
<p class="text-sm italic text-muted-foreground">
|
||||
Favorit #{favorite.value.quoteId}
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { locale } from 'svelte-i18n';
|
||||
import {
|
||||
APP_URLS,
|
||||
|
|
@ -15,7 +16,10 @@
|
|||
|
||||
const store = createAppNavigationStore();
|
||||
|
||||
// Detect dev mode
|
||||
// External apps that are hosted on separate subdomains
|
||||
const EXTERNAL_APPS = new Set<string>(['matrix', 'arcade']);
|
||||
|
||||
// Detect dev mode (only needed for external app URLs)
|
||||
const isDev =
|
||||
typeof window !== 'undefined' &&
|
||||
(window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1');
|
||||
|
|
@ -72,18 +76,20 @@
|
|||
return colors[status];
|
||||
}
|
||||
|
||||
function getAppUrl(appId: AppIconId): string | undefined {
|
||||
const urls = APP_URLS[appId];
|
||||
if (!urls) return undefined;
|
||||
return isDev ? urls.dev : urls.prod;
|
||||
}
|
||||
|
||||
function handleAppClick(app: ManaApp) {
|
||||
store.recordAppVisit(app.id);
|
||||
ManaCoreEvents.appOpened(app.id);
|
||||
const url = getAppUrl(app.id);
|
||||
if (url) {
|
||||
window.open(url, '_blank', 'noopener,noreferrer');
|
||||
|
||||
if (EXTERNAL_APPS.has(app.id)) {
|
||||
// External apps open in a new tab
|
||||
const urls = APP_URLS[app.id];
|
||||
if (urls) {
|
||||
const url = isDev ? urls.dev : urls.prod;
|
||||
window.open(url, '_blank', 'noopener,noreferrer');
|
||||
}
|
||||
} else {
|
||||
// Internal apps navigate within the unified app
|
||||
goto(`/${app.id}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
AI image generation microservice using FLUX.2 klein 4B model via flux2.c:
|
||||
|
||||
- **Port**: 3025
|
||||
- **Port**: 3026
|
||||
- **Framework**: Python + FastAPI
|
||||
- **Model**: FLUX.2 klein 4B (Black Forest Labs)
|
||||
- **Backend**: flux2.c (Pure C, MPS accelerated)
|
||||
|
|
@ -26,14 +26,14 @@ AI image generation microservice using FLUX.2 klein 4B model via flux2.c:
|
|||
# Development
|
||||
source .venv/bin/activate
|
||||
FLUX_BINARY=/opt/flux2/flux FLUX_MODEL_DIR=/opt/flux2/model \
|
||||
uvicorn app.main:app --host 0.0.0.0 --port 3025 --reload
|
||||
uvicorn app.main:app --host 0.0.0.0 --port 3026 --reload
|
||||
|
||||
# Production
|
||||
../../scripts/mac-mini/setup-image-gen.sh
|
||||
|
||||
# Test
|
||||
curl http://localhost:3025/health
|
||||
curl -X POST http://localhost:3025/generate \
|
||||
curl http://localhost:3026/health
|
||||
curl -X POST http://localhost:3026/generate \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"prompt": "A cat in space"}' | jq
|
||||
```
|
||||
|
|
@ -95,7 +95,7 @@ services/mana-image-gen/
|
|||
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `PORT` | `3025` | Service port |
|
||||
| `PORT` | `3026` | Service port |
|
||||
| `FLUX_BINARY` | `/opt/flux2/flux` | Path to flux2.c binary |
|
||||
| `FLUX_MODEL_DIR` | `/opt/flux2/model` | Path to model weights |
|
||||
| `DEFAULT_STEPS` | `4` | Default sampling steps |
|
||||
|
|
@ -128,7 +128,7 @@ The service is designed to be used by:
|
|||
### Example Integration (TypeScript)
|
||||
|
||||
```typescript
|
||||
const response = await fetch('http://localhost:3025/generate', {
|
||||
const response = await fetch('http://localhost:3026/generate', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
|
|
@ -139,7 +139,7 @@ const response = await fetch('http://localhost:3025/generate', {
|
|||
});
|
||||
|
||||
const result = await response.json();
|
||||
const imageUrl = `http://localhost:3025${result.image_url}`;
|
||||
const imageUrl = `http://localhost:3026${result.image_url}`;
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@ Local AI image generation using **FLUX.2 klein 4B** model via flux2.c.
|
|||
# 2. Start the service
|
||||
source .venv/bin/activate
|
||||
FLUX_BINARY=/opt/flux2/flux FLUX_MODEL_DIR=/opt/flux2/model \
|
||||
uvicorn app.main:app --host 0.0.0.0 --port 3025
|
||||
uvicorn app.main:app --host 0.0.0.0 --port 3026
|
||||
|
||||
# 3. Generate an image
|
||||
curl -X POST http://localhost:3025/generate \
|
||||
curl -X POST http://localhost:3026/generate \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"prompt": "A cat wearing sunglasses"}' | jq
|
||||
```
|
||||
|
|
@ -87,7 +87,7 @@ GET /models
|
|||
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `PORT` | `3025` | Service port |
|
||||
| `PORT` | `3026` | Service port |
|
||||
| `FLUX_BINARY` | `/opt/flux2/flux` | flux2.c binary path |
|
||||
| `FLUX_MODEL_DIR` | `/opt/flux2/model` | Model weights path |
|
||||
| `DEFAULT_STEPS` | `4` | Sampling steps |
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ logging.basicConfig(
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Configuration from environment
|
||||
PORT = int(os.getenv("PORT", "3025"))
|
||||
PORT = int(os.getenv("PORT", "3026"))
|
||||
MAX_PROMPT_LENGTH = int(os.getenv("MAX_PROMPT_LENGTH", "2000"))
|
||||
MIN_DIMENSION = int(os.getenv("MIN_DIMENSION", "256"))
|
||||
MAX_DIMENSION = int(os.getenv("MAX_DIMENSION", "2048"))
|
||||
|
|
|
|||
|
|
@ -212,16 +212,16 @@ echo "To start the service:"
|
|||
echo ""
|
||||
echo " cd $SCRIPT_DIR"
|
||||
echo " source .venv/bin/activate"
|
||||
echo " FLUX_BINARY=$FLUX_DIR/flux FLUX_MODEL_DIR=$MODEL_DIR uvicorn app.main:app --host 0.0.0.0 --port 3025"
|
||||
echo " FLUX_BINARY=$FLUX_DIR/flux FLUX_MODEL_DIR=$MODEL_DIR uvicorn app.main:app --host 0.0.0.0 --port 3026"
|
||||
echo ""
|
||||
echo "Or for development with auto-reload:"
|
||||
echo ""
|
||||
echo " FLUX_BINARY=$FLUX_DIR/flux FLUX_MODEL_DIR=$MODEL_DIR uvicorn app.main:app --host 0.0.0.0 --port 3025 --reload"
|
||||
echo " FLUX_BINARY=$FLUX_DIR/flux FLUX_MODEL_DIR=$MODEL_DIR uvicorn app.main:app --host 0.0.0.0 --port 3026 --reload"
|
||||
echo ""
|
||||
echo "Test the service:"
|
||||
echo ""
|
||||
echo " curl http://localhost:3025/health"
|
||||
echo " curl -X POST http://localhost:3025/generate \\"
|
||||
echo " curl http://localhost:3026/health"
|
||||
echo " curl -X POST http://localhost:3026/generate \\"
|
||||
echo " -H 'Content-Type: application/json' \\"
|
||||
echo " -d '{\"prompt\": \"A cat wearing sunglasses\"}'"
|
||||
echo ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue