Giter Site home page Giter Site logo

dream-api's Introduction

Hi! My name is Carter Roeser and I'm a computer science student at Oregon State University. I love building APIs and web applications to solve problems. My software has been used by Oregon State University, the State of Oregon, and thousands of users and clients around the world.

NPM Downloads

VWI Downloads

My Favorite Tools

Programming languages

Bash C C++ CSS HTML JavaScript Kotlin PHP Powershell Python Ruby SQL

Frameworks & Libraries

Ant Design Bootstrap Cordova Electron Express.js jQuery MongoDB MySQL Node.js OnsenUI React TailwindCSS Vite Vue

Platforms & Tools

Apache CircleCI Cloudflare Expo Firebase Git GitHub Actions Gitlab CI Google Cloud Nginx NPM Sentry Swagger Vercel Yarn

My Stats

dream-api's People

Contributors

cdgco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dream-api's Issues

error.response.data

Maybe I'm doing something wrong due to my lack of skills with NodeJS/Javascript but can't get the script working. Getting this response;

C:\Users\XXXXX\node_modules\dream-api\dist\dream.js:147
resolve(error.response.data);
^

TypeError: Cannot read properties of undefined (reading 'data')
at C:\Users\XXXXX\node_modules\dream-api\dist\dream.js:147:40
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Wombo API images coming out really broken

My wombo API images are coming out very weird and broken.

This is what I'm sending for image spec

"input_spec": {
"style": 5,
"prompt": 'Merlin',
"width": 512,
"height": 512
}

and its coming out completely busted. Help?

CORS error on post request

I'm trying to use the api but when it does the post requests I'm getting CORS errors, some idea that what can be happening?
pd: I love your api and how you have build it

Screenshot 2022-10-04 at 12 09 59

dream-api doesnt work

on using this code

const WomboDream = require('dream-api');
WomboDream.generateImage(79, 'My hero Academia', null, null, 'HIGH')
  .then(imageBuffer => {
    console.log(imageBuffer)
  });

it seems like i get an error

[AxiosError: Request failed with status code 404] {
  code: 'ERR_BAD_REQUEST',
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [Function: httpAdapter],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    env: { FormData: [Function] },
    validateStatus: [Function: validateStatus],
    headers: {
      Accept: 'application/json, text/plain, */*',
      Origin: 'https://app.wombo.art',
      Referer: 'https://app.wombo.art/',
      Authorization: 'bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjFiYjI2MzY4YTNkMWExNDg1YmNhNTJiNGY4M2JkYjQ5YjY0ZWM2MmYiLCJ0eXAiOiJKV1QifQ.eyJwcm92aWRlcl9pZCI6ImFub255bW91cyIsImlzcyI6Imh0dHBzOi8vc2VjdXJldG9rZW4uZ29vZ2xlLmNvbS9wYWludC1wcm9kIiwiYXVkIjoicGFpbnQtcHJvZCIsImF1dGhfdGltZSI6MTY4NDIyODE1OCwidXNlcl9pZCI6IkNJZ083NVIwUkdXNnJCUTlySm5TVVdvdnhSNjIiLCJzdWIiOiJDSWdPNzVSMFJHVzZyQlE5ckpuU1VXb3Z4UjYyIiwiaWF0IjoxNjg0MjI4MTU4LCJleHAiOjE2ODQyMzE3NTgsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnt9LCJzaWduX2luX3Byb3ZpZGVyIjoiYW5vbnltb3VzIn19.AEsxbdZyC0Q3cbf0Xj-rKPsT68FgLhpsFYq1R0hzFu6LqNLRD2gKUo-f2IuxCF24yvS5lAkKs5pxy9Z5x-oH72hg0Atmt-L0I3j8foYEpDSoT1H9651xC68kTgKdA1QQec-cE_5j3CMD4EdGaC8XeRGLGruB2C-weDKKmJAa9tuoUqI_Z-1WWWN8lPzA2fOjX_uAXHeKVPtBZyiK78St5WAM_2GDr9ox_BiNt33vebvHPDKGPVjKvresrzH_eW47d0sqsdTsElgoFFbXg7GEHnWiyY3_5lO0j-TLuB-kbg_UYDDieTgtIOD6nWABu30b7bOr_8E4pWFcnUoYYbeaiw',
      'Content-Type': 'text/plain;charset=UTF-8',
      service: 'Dream',
      'User-Agent': 'axios/0.27.2'
    },
    method: 'get',
    url: 'https://paint.api.wombo.ai/api/tasks/AxiosError: Request failed with status code 404',
    data: undefined
  },
  request: <ref *1> ClientRequest {
    _events: [Object: null prototype] {
      abort: [Function (anonymous)],
      aborted: [Function (anonymous)],
      connect: [Function (anonymous)],
      error: [Function (anonymous)],
      socket: [Function (anonymous)],
      timeout: [Function (anonymous)],
      finish: [Function: requestOnFinish]
    },
    _eventsCount: 7,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    destroyed: false,
    _last: true,
    chunkedEncoding: false,
    shouldKeepAlive: false,
    maxRequestsOnConnectionReached: false,
    _defaultKeepAlive: true,
    useChunkedEncodingByDefault: false,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    strictContentLength: false,
    _contentLength: 0,
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    _closed: false,
    socket: TLSSocket {
      _tlsOptions: [Object],
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      secureConnecting: false,
      _SNICallback: null,
      servername: 'paint.api.wombo.ai',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype],
      _eventsCount: 10,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'paint.api.wombo.ai',
      _closeAfterHandlingError: false,
      _readableState: [ReadableState],
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: undefined,
      _server: null,
      ssl: [TLSWrap],
      _requestCert: true,
      _rejectUnauthorized: true,
      parser: null,
      _httpMessage: [Circular *1],
      [Symbol(res)]: [TLSWrap],
      [Symbol(verified)]: true,
      [Symbol(pendingSession)]: null,
      [Symbol(async_id_symbol)]: 96,
      [Symbol(kHandle)]: [TLSWrap],
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kSetNoDelay)]: false,
      [Symbol(kSetKeepAlive)]: true,
      [Symbol(kSetKeepAliveInitialDelay)]: 60,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: [Object]
    },
    _header: 'GET /api/tasks/AxiosError:%20Request%20failed%20with%20status%20code%20404 HTTP/1.1\r\n' +
      'Accept: application/json, text/plain, */*\r\n' +
      'Origin: https://app.wombo.art\r\n' +
      'Referer: https://app.wombo.art/\r\n' +
      'Authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjFiYjI2MzY4YTNkMWExNDg1YmNhNTJiNGY4M2JkYjQ5YjY0ZWM2MmYiLCJ0eXAiOiJKV1QifQ.eyJwcm92aWRlcl9pZCI6ImFub255bW91cyIsImlzcyI6Imh0dHBzOi8vc2VjdXJldG9rZW4uZ29vZ2xlLmNvbS9wYWludC1wcm9kIiwiYXVkIjoicGFpbnQtcHJvZCIsImF1dGhfdGltZSI6MTY4NDIyODE1OCwidXNlcl9pZCI6IkNJZ083NVIwUkdXNnJCUTlySm5TVVdvdnhSNjIiLCJzdWIiOiJDSWdPNzVSMFJHVzZyQlE5ckpuU1VXb3Z4UjYyIiwiaWF0IjoxNjg0MjI4MTU4LCJleHAiOjE2ODQyMzE3NTgsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnt9LCJzaWduX2luX3Byb3ZpZGVyIjoiYW5vbnltb3VzIn19.AEsxbdZyC0Q3cbf0Xj-rKPsT68FgLhpsFYq1R0hzFu6LqNLRD2gKUo-f2IuxCF24yvS5lAkKs5pxy9Z5x-oH72hg0Atmt-L0I3j8foYEpDSoT1H9651xC68kTgKdA1QQec-cE_5j3CMD4EdGaC8XeRGLGruB2C-weDKKmJAa9tuoUqI_Z-1WWWN8lPzA2fOjX_uAXHeKVPtBZyiK78St5WAM_2GDr9ox_BiNt33vebvHPDKGPVjKvresrzH_eW47d0sqsdTsElgoFFbXg7GEHnWiyY3_5lO0j-TLuB-kbg_UYDDieTgtIOD6nWABu30b7bOr_8E4pWFcnUoYYbeaiw\r\n' +
      'Content-Type: text/plain;charset=UTF-8\r\n' +
      'service: Dream\r\n' +
      'User-Agent: axios/0.27.2\r\n' +
      'Host: paint.api.wombo.ai\r\n' +
      'Connection: close\r\n' +
      '\r\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: nop],
    agent: Agent {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      defaultPort: 443,
      protocol: 'https:',
      options: [Object: null prototype],
      requests: [Object: null prototype] {},
      sockets: [Object: null prototype],
      freeSockets: [Object: null prototype] {},
      keepAliveMsecs: 1000,
      keepAlive: false,
      maxSockets: Infinity,
      maxFreeSockets: 256,
      scheduling: 'lifo',
      maxTotalSockets: Infinity,
      totalSocketCount: 1,
      maxCachedSessions: 100,
      _sessionCache: [Object],
      [Symbol(kCapture)]: false
    },
    socketPath: undefined,
    method: 'GET',
    maxHeaderSize: undefined,
    insecureHTTPParser: undefined,
    joinDuplicateHeaders: undefined,
    path: '/api/tasks/AxiosError:%20Request%20failed%20with%20status%20code%20404',
    _ended: true,
    res: IncomingMessage {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 4,
      _maxListeners: undefined,
      socket: [TLSSocket],
      httpVersionMajor: 1,
      httpVersionMinor: 1,
      httpVersion: '1.1',
      complete: true,
      rawHeaders: [Array],
      rawTrailers: [],
      joinDuplicateHeaders: undefined,
      aborted: false,
      upgrade: false,
      url: '',
      method: null,
      statusCode: 404,
      statusMessage: 'Not Found',
      client: [TLSSocket],
      _consuming: true,
      _dumped: false,
      req: [Circular *1],
      responseUrl: 'https://paint.api.wombo.ai/api/tasks/AxiosError:%20Request%20failed%20with%20status%20code%20404', 
      redirects: [],
      [Symbol(kCapture)]: false,
      [Symbol(kHeaders)]: [Object],
      [Symbol(kHeadersCount)]: 16,
      [Symbol(kTrailers)]: null,
      [Symbol(kTrailersCount)]: 0
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: false,
    host: 'paint.api.wombo.ai',
    protocol: 'https:',
    _redirectable: Writable {
      _writableState: [WritableState],
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      _options: [Object],
      _ended: true,
      _ending: true,
      _redirectCount: 0,
      _redirects: [],
      _requestBodyLength: 0,
      _requestBodyBuffers: [],
      _onNativeResponse: [Function (anonymous)],
      _currentRequest: [Circular *1],
      _currentUrl: 'https://paint.api.wombo.ai/api/tasks/AxiosError:%20Request%20failed%20with%20status%20code%20404', 
      [Symbol(kCapture)]: false
    },
    [Symbol(kCapture)]: false,
    [Symbol(kBytesWritten)]: 0,
    [Symbol(kEndCalled)]: true,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [Array],
      origin: [Array],
      referer: [Array],
      authorization: [Array],
      'content-type': [Array],
      service: [Array],
      'user-agent': [Array],
      host: [Array]
    },
    [Symbol(errored)]: null,
    [Symbol(kUniqueHeaders)]: null
  },
  response: {
    status: 404,
    statusText: 'Not Found',
    headers: {
      date: 'Tue, 16 May 2023 09:09:21 GMT',
      'content-type': 'application/json',
      'content-length': '22',
      connection: 'close',
      server: 'uvicorn',
      'access-control-allow-credentials': 'true',
      'access-control-allow-origin': 'https://app.wombo.art',
      vary: 'Origin'
    },
    config: {
      transitional: [Object],
      adapter: [Function: httpAdapter],
      transformRequest: [Array],
      transformResponse: [Array],
      timeout: 0,
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      env: [Object],
      validateStatus: [Function: validateStatus],
      headers: [Object],
      method: 'get',
      url: 'https://paint.api.wombo.ai/api/tasks/AxiosError: Request failed with status code 404',
      data: undefined
    },
    request: <ref *1> ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: false,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      strictContentLength: false,
      _contentLength: 0,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: false,
      socket: [TLSSocket],
      _header: 'GET /api/tasks/AxiosError:%20Request%20failed%20with%20status%20code%20404 HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'Origin: https://app.wombo.art\r\n' +
        'Referer: https://app.wombo.art/\r\n' +
        'Authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjFiYjI2MzY4YTNkMWExNDg1YmNhNTJiNGY4M2JkYjQ5YjY0ZWM2MmYiLCJ0eXAiOiJKV1QifQ.eyJwcm92aWRlcl9pZCI6ImFub255bW91cyIsImlzcyI6Imh0dHBzOi8vc2VjdXJldG9rZW4uZ29vZ2xlLmNvbS9wYWludC1wcm9kIiwiYXVkIjoicGFpbnQtcHJvZCIsImF1dGhfdGltZSI6MTY4NDIyODE1OCwidXNlcl9pZCI6IkNJZ083NVIwUkdXNnJCUTlySm5TVVdvdnhSNjIiLCJzdWIiOiJDSWdPNzVSMFJHVzZyQlE5ckpuU1VXb3Z4UjYyIiwiaWF0IjoxNjg0MjI4MTU4LCJleHAiOjE2ODQyMzE3NTgsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnt9LCJzaWduX2luX3Byb3ZpZGVyIjoiYW5vbnltb3VzIn19.AEsxbdZyC0Q3cbf0Xj-rKPsT68FgLhpsFYq1R0hzFu6LqNLRD2gKUo-f2IuxCF24yvS5lAkKs5pxy9Z5x-oH72hg0Atmt-L0I3j8foYEpDSoT1H9651xC68kTgKdA1QQec-cE_5j3CMD4EdGaC8XeRGLGruB2C-weDKKmJAa9tuoUqI_Z-1WWWN8lPzA2fOjX_uAXHeKVPtBZyiK78St5WAM_2GDr9ox_BiNt33vebvHPDKGPVjKvresrzH_eW47d0sqsdTsElgoFFbXg7GEHnWiyY3_5lO0j-TLuB-kbg_UYDDieTgtIOD6nWABu30b7bOr_8E4pWFcnUoYYbeaiw\r\n' +
        'Content-Type: text/plain;charset=UTF-8\r\n' +
        'service: Dream\r\n' +
        'User-Agent: axios/0.27.2\r\n' +
        'Host: paint.api.wombo.ai\r\n' +
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'paint.api.wombo.ai',
      protocol: 'https:',
      _redirectable: [Writable],
      [Symbol(kCapture)]: false,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(kEndCalled)]: true,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype],
      [Symbol(errored)]: null,
      [Symbol(kUniqueHeaders)]: null
    },
  }
}

API usage restricted?

Hello.
generateImage returns this regardless of authentication. Also latest test build failed - looks like it's universal restriction

{
  detail: 'API abuse is bad for your health. https://www.w.ai/dream-api'
}

Result after upload

Any idea why we got not the same result when Input Image on web site ?
when use api is look give like unfinished result
thank's for info

node:internal/process/promises:288

got this
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#".] {
code: 'ERR_UNHANDLED_REJECTION'
}

after check

// Generate image from prompt only
let image1 = await WomboDream.generateImage(1, "dog", token).catch((error) => {
// Handle the error here
console.error("Error occurred:", error);
});

it's
Error occurred: { detail: 'Invalid token' }

maybie just miss somethinks not sure like Bearer on token, ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.