refactor: move code to avoid conflicts with "http" namespace
@ -10,7 +10,7 @@ def run_server_cmd():
|
||||
"""Run a HTTP API server."""
|
||||
import uvicorn
|
||||
|
||||
from imaginairy.http.app import app
|
||||
from imaginairy.http_app.app import app
|
||||
from imaginairy.log_utils import configure_logging
|
||||
|
||||
configure_logging(level="DEBUG")
|
||||
|
@ -10,8 +10,8 @@ from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.responses import FileResponse, JSONResponse, StreamingResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
|
||||
from imaginairy.http.stablestudio import routes
|
||||
from imaginairy.http.utils import generate_image
|
||||
from imaginairy.http_app.stablestudio import routes
|
||||
from imaginairy.http_app.utils import generate_image
|
||||
from imaginairy.schema import ImaginePrompt
|
||||
|
||||
logger = logging.getLogger(__name__)
|
Before Width: | Height: | Size: 957 B After Width: | Height: | Size: 957 B |
Before Width: | Height: | Size: 489 KiB After Width: | Height: | Size: 489 KiB |
Before Width: | Height: | Size: 507 B After Width: | Height: | Size: 507 B |
Before Width: | Height: | Size: 600 B After Width: | Height: | Size: 600 B |
@ -3,7 +3,7 @@ from typing import List, Optional
|
||||
|
||||
from pydantic import BaseModel, Extra, Field, HttpUrl, validator
|
||||
|
||||
from imaginairy.http.utils import Base64Bytes
|
||||
from imaginairy.http_app.utils import Base64Bytes
|
||||
from imaginairy.schema import ImaginePrompt
|
||||
|
||||
|
@ -3,21 +3,21 @@ import uuid
|
||||
from fastapi import APIRouter
|
||||
from fastapi.concurrency import run_in_threadpool
|
||||
|
||||
from imaginairy.http.stablestudio.models import (
|
||||
from imaginairy.http_app.stablestudio.models import (
|
||||
StableStudioBatchRequest,
|
||||
StableStudioBatchResponse,
|
||||
StableStudioImage,
|
||||
StableStudioModel,
|
||||
StableStudioSampler,
|
||||
)
|
||||
from imaginairy.http.utils import generate_image_b64
|
||||
from imaginairy.http_app.utils import generate_image_b64
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.post("/generate", response_model=StableStudioBatchResponse)
|
||||
async def generate(studio_request: StableStudioBatchRequest):
|
||||
from imaginairy.http.app import gpu_lock
|
||||
from imaginairy.http_app.app import gpu_lock
|
||||
|
||||
generated_images = []
|
||||
imagine_prompt = studio_request.input.to_imagine_prompt()
|