A great substitute for sofa beds and futons

Make a bed cushion
These are waterfall cushions. The boxing is on the sides and back only. They could be made completely boxed with or without welt or with cut-out corners or "butterfly" corners.Needing a guest bed my wife and I decided to use large cushions that when put together would make a queen size bed. Later I will construct a simple frame like the one in our Make and Upholster an Ottoman instruction. The frames will sit on top of each other with one cushion on top and the other against the wall or both cushions on top of the frame to make a sofa. This configuration takes up the least amout of room in our extra bedroom. The two cushions fit snugly together when covered with a fitted sheet.
There are many combinations you could do. You could, of course, skip the frame altogether and just have the cushions or make four cushions and stack them for a sofa and make one or two beds for guests or four single beds (big enough for young people or some adults.) You could make back cushions or use a bunch of throw pillows to lean against the wall-this queen size example is much deeper than an ordinary sofa. You could also make a frame with a back or arms. Think through the seating height you want by comparing with your existing furniture.
Use a framers square
Use a framers square to make sure you are getting straight cuts.

See Basic Cutting and Sewing before starting this project. Determine what size you want your mattress to finish and how thick you want the foam. We used 5" foam.
Standard mattress sizes are: twin 39x75, full 54x75, queen 60x80 and king 76x80. I bought the queen size then split it with a professional foam saw. You can also use an electric carving knife or miter box saw (snub nose). Pull the miter box saw the length of the foam rather than going back and forth like sawing wood. You can buy 27" wide foam which you wouldn't have to cut for a full size mattress.

We used an extra wide canvas material. You could also use flat sheets. It would depend on the sheet, but standard sizes would be approximately: twin 66"x96", full 76"x96", queen 86"x102", or king 96"x102".

Fold and notch the sides and find the center of the side where the zipper will be installed.

You wouldn't be able to railroad the fabric like we did here if you have the standard 54" wide upholstery material. However on some upholstery jobs, including some sofa inside backs, it is necessary to piece the fabric. Usually you would use a full width adding fabric to both sides. Allow for all your seams. After sewing you can iron the seams flat and/or top stitch them if extra strength is needed.

If you are not going to put a wrap over your foam then it is a good idea to have your new cover finish a 1/2" to 1 " shorter than your foam to prevent wrinkling. The foam will kick out the cover to the correct size. Also cut the boxing slightly smaller.

Zipper boxing

Front and back of zipper boxing.
See How to Sew a Boxed and Welted Cushion for how to sew zipper boxing.

Notch your boxing. Line up notches and sew to within a 1/2" of the edge of the boxing.
Sew bed cushion.
Leave your sewing machine needle in the fabric as you go around the corner. You can make a couple of cuts on the main piece of material  to relax the fabric more during the turn.

Fold boxing back 1 1/2"-2". On the main piece of fabric notch a point that is the same distance as you have left between the boxing and edge of the fabric.

In this view we have turned the new cover over and are sewing the main fabric piece to the front of the boxing. Lap over the previous stitching a half inch or so. Make a couple of cuts near the corner to relax the material as you round the corner. Sew to about 1/2" of the corner, leave the needle in and turn.

Check to make sure the notch you made on the main cushion plate is going to line up with the corner of the fold you made in the boxing.

Sew zipper boxing
Estimate where to begin installing the zipper boxing and sew. Before sewing the second side make yet another notch in the zipper boxing that coincides with the one on the back edge of the main material piece. This one will need to line up with the notch on the lower edge of the main plate.
Also notch the corners of the boxing. This will give you three places to line up to be sure that you end up with a nice square cushion.
Filling cushions
Here is the completed cushion viewed wrong side out. Be careful filling large cushions so that you don't put too much pressure on the part with the zipper slide and break some teeth out of the zipper. 
Over time the zipper boxing may ride up some (especially without a wrap). You can correct this easily without opening the cover by grabbing and pulling the back seam with your fingers and side of your hand and with the other hand brushing the material backwards from the front of the cushion. 
How to make a bed frame
Ottoman frame before last side is attached.

You can build  2 frames to sit on top of each other. See How to Make an Ottoman Frame. Be sure to brace the frame a couple of times to keep the webbing from drawing  the boards in. You could upholster the frame or stain or paint it.