refactor: move code to avoid conflicts with "http" namespace

This commit is contained in:
Bryce 2023-10-10 22:33:24 -07:00 committed by Bryce Drennan
parent 703fb6e331
commit 6cd519cdb2
18 changed files with 7 additions and 7 deletions

View File

@ -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")

View File

@ -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__)

View File

Before

Width:  |  Height:  |  Size: 957 B

After

Width:  |  Height:  |  Size: 957 B

View File

Before

Width:  |  Height:  |  Size: 489 KiB

After

Width:  |  Height:  |  Size: 489 KiB

View File

Before

Width:  |  Height:  |  Size: 507 B

After

Width:  |  Height:  |  Size: 507 B

View File

Before

Width:  |  Height:  |  Size: 600 B

After

Width:  |  Height:  |  Size: 600 B

View File

@ -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

View File

@ -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()