Skip to content

Commit

Permalink
refactor: move code to avoid conflicts with "http" namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
brycedrennan committed Oct 11, 2023
1 parent 703fb6e commit 6cd519c
Show file tree
Hide file tree
Showing 18 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion imaginairy/cli/run_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions imaginairy/http/app.py → imaginairy/http_app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
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__)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
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()
Expand Down
File renamed without changes.

0 comments on commit 6cd519c

Please sign in to comment.